Skip to content

Commit 0ca463a

Browse files
authored
Fix compilation of pico_double_test on llvm 15 - workaround compiler bug (#2258)
1 parent 7c023fa commit 0ca463a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/pico_float_test/pico_double_test.c

+6
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,13 @@ int main() {
365365
printf("EXP %10.18g\n", check_close1(exp, x));
366366
printf("LN %10.18g\n", check_close1(log, x));
367367
printf("POW %10.18f\n", check_close2(pow, x, x));
368+
#if LIB_PICO_DOUBLE_PICO && __clang_major__ == 15
369+
// seem to be a compiler/linker bug here with calls to __real_trunc, so just call trunc rather than doing
370+
// a closeness check - at least we will know that the call works
371+
printf("TRUNC %10.18f\n", trunc(x));
372+
#else
368373
printf("TRUNC %10.18f\n", check_close1(trunc, x));
374+
#endif
369375
printf("LDEXP %10.18f\n", check_close2(ldexp, x, x));
370376
// todo come pack
371377
// printf("FMOD %10.18f\n", check_close2(fmod, x, 3.0f));

0 commit comments

Comments
 (0)