1 /* { dg-do compile } */ 2 /* { dg-require-effective-target inf } */ 3 /* { dg-options "-O1 -fno-trapping-math -fno-finite-math-only -fdump-tree-optimized" } */ 4 5 extern void f(int); 6 extern void link_error (); 7 8 extern float x; 9 extern double y; 10 extern long double z; 11 12 int main()13main () 14 { 15 double nan = __builtin_nan (""); 16 float nanf = __builtin_nanf (""); 17 long double nanl = __builtin_nanl (""); 18 19 double pinf = __builtin_inf (); 20 float pinff = __builtin_inff (); 21 long double pinfl = __builtin_infl (); 22 23 if (__builtin_finite (pinf)) 24 link_error (); 25 if (__builtin_finitef (pinff)) 26 link_error (); 27 if (__builtin_finitel (pinfl)) 28 link_error (); 29 30 if (__builtin_finite (nan)) 31 link_error (); 32 if (__builtin_finitef (nanf)) 33 link_error (); 34 if (__builtin_finitel (nanl)) 35 link_error (); 36 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 (); 43 } 44 45 46 /* Check that all instances of link_error were subject to DCE. */ 47 /* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */ 48