libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / range-sqrt.c
blobd2a2626add3db3c3347cb44e644ead0aedc4b417
1 // { dg-do compile }
2 // { dg-options "-O2 -fdump-tree-evrp -fno-thread-jumps" }
4 #include <math.h>
6 void use (double);
7 void link_error ();
9 void
10 foo (double x)
12 if (__builtin_isnan (x))
13 __builtin_unreachable ();
14 x = sqrt (x);
15 if (x < -0.0)
16 link_error ();
17 use (x);
20 void
21 bar (double x)
23 if (!__builtin_isnan (sqrt (x)))
25 if (__builtin_isnan (x))
26 link_error ();
27 if (x < -0.0)
28 link_error ();
32 void
33 stool (double x)
35 double res1 = sqrt (x);
36 double res2 = __builtin_sqrt (x);
37 if (res1 < -0.0 || res2 < -0.0)
38 link_error ();
41 // { dg-final { scan-tree-dump-not "link_error" "evrp" { target { { *-*-linux* } && { glibc } } } } }