1 /* Test rint and related functions expanded inline for 387. All 2 should be expanded when spurious "inexact" allowed. */ 3 /* { dg-do compile } */ 4 /* { dg-options "-O2 -mfancy-math-387 -mfpmath=387 -ffp-int-builtin-inexact" } */ 5 /* { dg-add-options c99_runtime } */ 6 7 #define TEST(FN, TYPE) \ 8 do \ 9 { \ 10 volatile TYPE a = 1.5, b; \ 11 b = FN (a); \ 12 } \ 13 while (0) 14 15 #define FN_TESTS(FN) \ 16 do \ 17 { \ 18 TEST (__builtin_ ## FN, double); \ 19 TEST (__builtin_ ## FN ## f, float); \ 20 TEST (__builtin_ ## FN ## l, long double); \ 21 } \ 22 while (0) 23 24 void test(void)25test (void) 26 { 27 FN_TESTS (rint); 28 FN_TESTS (ceil); 29 FN_TESTS (floor); 30 FN_TESTS (trunc); 31 } 32 33 /* { dg-final { scan-assembler-not "\[ \t\]rint" } } */ 34 /* { dg-final { scan-assembler-not "\[ \t\]ceil" } } */ 35 /* { dg-final { scan-assembler-not "\[ \t\]floor" } } */ 36 /* { dg-final { scan-assembler-not "\[ \t\]trunc" } } */ 37