Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / gcc.dg / builtins-45.c
blob871e802e191d707eab9027f192681416ce8aa14e
1 /* { dg-do compile } */
2 /* { dg-require-effective-target inf } */
3 /* { dg-options "-O1 -fno-trapping-math -fno-finite-math-only -fdump-tree-optimized" } */
5 extern void f(int);
6 extern void link_error ();
8 extern float x;
9 extern double y;
10 extern long double z;
12 int
13 main ()
15 double nan = __builtin_nan ("");
16 float nanf = __builtin_nanf ("");
17 long double nanl = __builtin_nanl ("");
19 double pinf = __builtin_inf ();
20 float pinff = __builtin_inff ();
21 long double pinfl = __builtin_infl ();
23 if (__builtin_finite (pinf))
24 link_error ();
25 if (__builtin_finitef (pinff))
26 link_error ();
27 if (__builtin_finitel (pinfl))
28 link_error ();
30 if (__builtin_finite (nan))
31 link_error ();
32 if (__builtin_finitef (nanf))
33 link_error ();
34 if (__builtin_finitel (nanl))
35 link_error ();
37 if (!__builtin_finite (4.0))
38 link_error ();
39 if (!__builtin_finitef (4.0))
40 link_error ();
41 if (!__builtin_finitel (4.0))
42 link_error ();
46 /* Check that all instances of link_error were subject to DCE. */
47 /* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */