libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / range-sqrt-2.c
bloba146d9d14a5aa55fefa5325c9416f6586e24643e
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 (x < 1.0 || x > 9.0)
13 __builtin_unreachable ();
14 x = sqrt (x);
15 if (x < 0.875 || x > 3.125)
16 link_error ();
17 use (x);
20 void
21 bar (double x)
23 if (sqrt (x) >= 2.0 && sqrt (x) <= 4.0)
25 if (__builtin_isnan (x))
26 link_error ();
27 if (x < 3.875 || x > 16.125)
28 link_error ();
32 void
33 stool (double x)
35 if (x >= 64.0)
37 double res1 = sqrt (x);
38 double res2 = __builtin_sqrt (x);
39 if (res1 < 7.875 || res2 < 7.875)
40 link_error ();
44 // { dg-final { scan-tree-dump-not "link_error" "evrp" { target { { *-*-linux* } && { glibc } } } } }