1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fno-trapping-math -fno-finite-math-only -fdump-tree-gimple -fdump-tree-optimized" } */
5 extern void link_error ();
14 double nan
= __builtin_nan ("");
16 /* The SPU single-precision floating point format does not support NANs. */
17 float nanf
= __builtin_nanf ("");
19 long double nanl
= __builtin_nanl ("");
21 if (!__builtin_isnan (nan
))
24 if (!__builtin_isnan (nanf
))
26 if (!__builtin_isnanf (nanf
))
29 if (!__builtin_isnan (nanl
))
31 if (!__builtin_isnanl (nanl
))
34 if (__builtin_isnan (4.0))
36 if (__builtin_isnan (4.0))
38 if (__builtin_isnanf (4.0))
40 if (__builtin_isnan (4.0))
42 if (__builtin_isnanl (4.0))
45 f (__builtin_isnan (x
));
46 f (__builtin_isnan (y
));
47 f (__builtin_isnanf (y
));
48 f (__builtin_isnan (z
));
49 f (__builtin_isnanl (z
));
53 /* Check that all instances of __builtin_isnan were folded. */
54 /* { dg-final { scan-tree-dump-times "isnan" 0 "gimple" } } */
55 /* { dg-final { cleanup-tree-dump "gimple" } } */
57 /* Check that all instances of link_error were subject to DCE. */
58 /* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */
59 /* { dg-final { cleanup-tree-dump "optimized" } } */