1 /* PR tree-optimization/86274 - SEGFAULT when logging std::to_string(NAN)
3 { dg-options "-O2 -Wall" } */
6 #define nan(x) __builtin_nan (x)
8 volatile double nan_0
= nan ("0");
9 volatile double nan_x
= nan (X
);
15 /* Verify that folded results match those of the library calls. */
16 int cst_n_0
= __builtin_sprintf (buf
, "%g", nan ("0"));
17 int cst_n_x
= __builtin_sprintf (buf
, "%g", nan (X
));
19 int var_n_0
= __builtin_sprintf (buf
, "%g", nan_0
);
20 int var_n_x
= __builtin_sprintf (buf
, "%g", nan_x
);
22 if (cst_n_0
!= var_n_0
)
25 if (cst_n_x
!= var_n_x
)