libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / builtin-convert-4.c
blobf201f15661326f09503be75ad3c2bede5a1e2c4b
1 /* Copyright (C) 2007 Free Software Foundation.
3 Verify that nearbyint isn't transformed into e.g. rint or lrint
4 when -ftrapping-math is set.
6 Written by Kaveh ghazi, 2007-03-04. */
8 /* { dg-do compile } */
9 /* { dg-options "-ftrapping-math -fdump-tree-original" } */
11 #include "../builtins-config.h"
13 extern void bar (long);
15 #define TESTIT(FUNC) do { \
16 bar (__builtin_##FUNC(d)); \
17 bar (__builtin_##FUNC##f(f)); \
18 bar (__builtin_##FUNC##l(ld)); \
19 } while (0)
21 void __attribute__ ((__noinline__)) foo (double d, float f, long double ld)
23 TESTIT(nearbyint);
26 int main()
28 foo (1.0, 2.0, 3.0);
29 return 0;
32 /* { dg-final { scan-tree-dump-times "nearbyint " 1 "original" } } */
33 /* { dg-final { scan-tree-dump-times "nearbyintf" 1 "original" } } */
34 /* { dg-final { scan-tree-dump-times "nearbyintl" 1 "original" } } */