1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fno-trapping-math -fdump-tree-gimple -fdump-tree-optimized" } */
5 extern void link_error ();
14 double nan
= __builtin_nan ("");
15 float nanf
= __builtin_nanf ("");
16 long double nanl
= __builtin_nanl ("");
18 if (!__builtin_isnan (nan
))
20 if (!__builtin_isnan (nanf
))
22 if (!__builtin_isnanf (nanf
))
24 if (!__builtin_isnan (nanl
))
26 if (!__builtin_isnanl (nanl
))
29 if (__builtin_isnan (4.0))
31 if (__builtin_isnan (4.0))
33 if (__builtin_isnanf (4.0))
35 if (__builtin_isnan (4.0))
37 if (__builtin_isnanl (4.0))
40 f (__builtin_isnan (x
));
41 f (__builtin_isnan (y
));
42 f (__builtin_isnanf (y
));
43 f (__builtin_isnan (z
));
44 f (__builtin_isnanl (z
));
48 /* Check that all instances of __builtin_isnan were folded. */
49 /* { dg-final { scan-tree-dump-times "isnan" 0 "gimple" } } */
50 /* { dg-final { cleanup-tree-dump "gimple" } } */
52 /* Check that all instances of link_error were subject to DCE. */
53 /* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */
54 /* { dg-final { cleanup-tree-dump "optimized" } } */