Skip to content

Commit 0f78159

Browse files
committed
library-check: fixup missing __builtin_ffs check
1 parent f9a7807 commit 0f78159

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/ansi-c/library/math.c

+7
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,13 @@ long double __builtin_huge_vall(void)
317317
#pragma CPROVER check pop
318318
}
319319

320+
/* FUNCTION: __builtin_ffs */
321+
322+
//int __builtin_ffs(float f)
323+
//{
324+
// return simplify_exprt::simplify_ffs(f);
325+
//}
326+
320327
/* FUNCTION: _dsign */
321328

322329
int _dsign(double d)

src/ansi-c/library_check.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ for f in "$@"; do
2222
[ "${ec}" -eq 0 ] || exit "${ec}"
2323
done
2424

25-
# Make sure all internal library functions have tests exercising them:
25+
echo Make sure all internal library functions have tests exercising them
2626
grep '^/\* FUNCTION:' ../*/library/* | cut -f3 -d" " | sort -u > __functions
2727

2828
# Some functions are not expected to have tests:
@@ -81,7 +81,7 @@ perl -p -i -e 's/^__vfprintf_chk\n//' __functions # vfprintf-01/__vfprintf_chk.d
8181

8282
# Some functions are covered by tests in other folders:
8383
perl -p -i -e 's/^__spawned_thread\n//' __functions # any pthread_create tests
84-
perl -p -i -e 's/^__builtin_ffsl?l?\n//' __functions # cbmc/__builtin_ffs-01
84+
#perl -p -i -e 's/^__builtin_ffsl?l?\n//' __functions # cbmc/__builtin_ffs-01
8585
perl -p -i -e 's/^__builtin_[su]addl?l?_overflow\n//' __functions # cbmc/gcc_builtin_add_overflow
8686
perl -p -i -e 's/^__builtin_[su]mull?l?_overflow\n//' __functions # cbmc/gcc_builtin_mul_overflow
8787
perl -p -i -e 's/^__builtin_[su]subl?l?_overflow\n//' __functions # cbmc/gcc_builtin_sub_overflow
@@ -101,13 +101,14 @@ perl -p -i -e 's/^_mm_setr_epi(16|32)\n//' __functions # cbmc/SIMD1
101101
perl -p -i -e 's/^_mm_setr_pi16\n//' __functions # cbmc/SIMD1
102102
perl -p -i -e 's/^_mm_subs_ep[iu]16\n//' __functions # cbmc/SIMD1
103103

104-
ls ../../regression/cbmc-library/ | grep -- - | cut -f1 -d- | sort -u > __tests
104+
ls ../../regression/cbmc-library/ | grep -- -0 | cut -f1 -d- | sort -u > __tests
105105
diff -u __tests __functions
106106
ec="${?}"
107-
rm __functions __tests
108107
if [ $ec != 0 ]; then
109108
echo "Tests and library functions don't match."
110109
echo "Lines prefixed with - are tests not matching any library function."
111110
echo "Lines prefixed with + are functions lacking a test."
111+
else
112+
rm __functions __tests
112113
fi
113114
exit "${ec}"

0 commit comments

Comments
 (0)