Skip to content

Commit f58af60

Browse files
committed
library-check: fixup missing __builtin_ffs check
1 parent 08b2f2f commit f58af60

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
@@ -21,7 +21,7 @@ for f in "$@"; do
2121
[ "${ec}" -eq 0 ] || exit "${ec}"
2222
done
2323

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

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

6363
# Some functions are covered by tests in other folders:
6464
perl -p -i -e 's/^__spawned_thread\n//' __functions # any pthread_create tests
65-
perl -p -i -e 's/^__builtin_ffsl?l?\n//' __functions # cbmc/__builtin_ffs-01
65+
#perl -p -i -e 's/^__builtin_ffsl?l?\n//' __functions # cbmc/__builtin_ffs-01
6666
perl -p -i -e 's/^__builtin_[su]addl?l?_overflow\n//' __functions # cbmc/gcc_builtin_add_overflow
6767
perl -p -i -e 's/^__builtin_[su]mull?l?_overflow\n//' __functions # cbmc/gcc_builtin_mul_overflow
6868
perl -p -i -e 's/^__builtin_[su]subl?l?_overflow\n//' __functions # cbmc/gcc_builtin_sub_overflow
@@ -82,13 +82,14 @@ perl -p -i -e 's/^_mm_setr_epi(16|32)\n//' __functions # cbmc/SIMD1
8282
perl -p -i -e 's/^_mm_setr_pi16\n//' __functions # cbmc/SIMD1
8383
perl -p -i -e 's/^_mm_subs_ep[iu]16\n//' __functions # cbmc/SIMD1
8484

85-
ls ../../regression/cbmc-library/ | grep -- - | cut -f1 -d- | sort -u > __tests
85+
ls ../../regression/cbmc-library/ | grep -- -0 | cut -f1 -d- | sort -u > __tests
8686
diff -u __tests __functions
8787
ec="${?}"
88-
rm __functions __tests
8988
if [ $ec != 0 ]; then
9089
echo "Tests and library functions don't match."
9190
echo "Lines prefixed with - are tests not matching any library function."
9291
echo "Lines prefixed with + are functions lacking a test."
92+
else
93+
rm __functions __tests
9394
fi
9495
exit "${ec}"

0 commit comments

Comments
 (0)