@@ -17,3 +17,53 @@ for f in "$@"; do
17
17
rm __libcheck.s __libcheck.i __libcheck.c
18
18
[ " ${ec} " -eq 0 ] || exit " ${ec} "
19
19
done
20
+
21
+ # Make sure all internal library functions have tests exercising them:
22
+ grep ' ^/\* FUNCTION:' ../* /library/* | cut -f3 -d" " | sort -u > __functions
23
+
24
+ # Some functions are not expected to have tests:
25
+ sed -i ' /^__CPROVER_jsa_synthesise$/d' __functions
26
+ sed -i ' /^java::java.io.InputStream.read:()I$/d' __functions
27
+
28
+ # Some functions are implicitly covered by running on different operating
29
+ # systems:
30
+ sed -i ' /^_fopen$/d' __functions # fopen, macOS
31
+ sed -i ' /^_pipe$/d' __functions # pipe, macOS
32
+ sed -i ' /^_time32$/d' __functions # time, Windows
33
+ sed -i ' /^_time64$/d' __functions # time, Windows
34
+
35
+ # Some functions are covered by existing tests:
36
+ sed -i ' /^__builtin_clzl$/d' __functions # __builtin_clz-01
37
+ sed -i ' /^__builtin_clzll$/d' __functions # __builtin_clz-01
38
+ sed -i ' /^__builtin_ffsl$/d' __functions # __builtin_ffs-01
39
+ sed -i ' /^__builtin_ffsll$/d' __functions # __builtin_ffs-01
40
+ sed -i ' /^__lzcnt$/d' __functions # __builtin_clz-01
41
+ sed -i ' /^__lzcnt16$/d' __functions # __builtin_clz-01
42
+ sed -i ' /^__lzcnt64$/d' __functions # __builtin_clz-01
43
+ sed -i ' /^fclose_cleanup$/d' __functions # fopen
44
+
45
+ # Some functions are covered by tests in other folders:
46
+ sed -i ' /^__builtin_sadd_overflow$/d' __functions # cbmc/gcc_builtin_add_overflow
47
+ sed -i ' /^__builtin_saddl_overflow$/d' __functions # cbmc/gcc_builtin_add_overflow
48
+ sed -i ' /^__builtin_saddll_overflow$/d' __functions # cbmc/gcc_builtin_add_overflow
49
+ sed -i ' /^__builtin_smul_overflow$/d' __functions # cbmc/gcc_builtin_mul_overflow
50
+ sed -i ' /^__builtin_smull_overflow$/d' __functions # cbmc/gcc_builtin_mul_overflow
51
+ sed -i ' /^__builtin_smulll_overflow$/d' __functions # cbmc/gcc_builtin_mul_overflow
52
+ sed -i ' /^__builtin_ssub_overflow$/d' __functions # cbmc/gcc_builtin_sub_overflow
53
+ sed -i ' /^__builtin_ssubl_overflow$/d' __functions # cbmc/gcc_builtin_sub_overflow
54
+ sed -i ' /^__builtin_ssubll_overflow$/d' __functions # cbmc/gcc_builtin_sub_overflow
55
+ sed -i ' /^__builtin_uadd_overflow$/d' __functions # cbmc/gcc_builtin_add_overflow
56
+ sed -i ' /^__builtin_uaddl_overflow$/d' __functions # cbmc/gcc_builtin_add_overflow
57
+ sed -i ' /^__builtin_uaddll_overflow$/d' __functions # cbmc/gcc_builtin_add_overflow
58
+ sed -i ' /^__builtin_umul_overflow$/d' __functions # cbmc/gcc_builtin_mul_overflow
59
+ sed -i ' /^__builtin_umull_overflow$/d' __functions # cbmc/gcc_builtin_mul_overflow
60
+ sed -i ' /^__builtin_umulll_overflow$/d' __functions # cbmc/gcc_builtin_mul_overflow
61
+ sed -i ' /^__builtin_usub_overflow$/d' __functions # cbmc/gcc_builtin_sub_overflow
62
+ sed -i ' /^__builtin_usubl_overflow$/d' __functions # cbmc/gcc_builtin_sub_overflow
63
+ sed -i ' /^__builtin_usubll_overflow$/d' __functions # cbmc/gcc_builtin_sub_overflow
64
+
65
+ ls ../../regression/cbmc-library/ | grep -- - | cut -f1 -d- | sort -u > __tests
66
+ diff -u __tests __functions
67
+ ec=" ${?} "
68
+ rm __functions __tests
69
+ exit " ${ec} "
0 commit comments