gcc/testsuite/gcc.dg/builtins-57.c
raw| 1 | /* { dg-do link } */ |
| 2 | /* { dg-options "-std=c99 -ffinite-math-only -O" } */ |
| 3 | |
| 4 | #include "builtins-config.h" |
| 5 | |
| 6 | extern void link_error (void); |
| 7 | |
| 8 | extern double floor (double); |
| 9 | extern double trunc (double); |
| 10 | extern double fabs (double); |
| 11 | |
| 12 | void test (double x) |
| 13 | { |
| 14 | #ifdef HAVE_C99_RUNTIME |
| 15 | if (floor (fabs (x)) != trunc (fabs (x))) |
| 16 | link_error (); |
| 17 | #endif |
| 18 | if (__builtin_lfloor (fabs (x)) != (long)fabs (x)) |
| 19 | link_error (); |
| 20 | } |
| 21 | |
| 22 | int main (void) |
| 23 | { |
| 24 | return 0; |
| 25 | } |