]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/tree-ssa/range-sqrt.c
Fix profile update in tree_transform_and_unroll_loop
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / range-sqrt.c
CommitLineData
ba39d2be
JJ
1// { dg-do compile }
2// { dg-options "-O2 -fdump-tree-evrp -fno-thread-jumps" }
3
4#include <math.h>
5
6void use (double);
7void link_error ();
8
9void
10foo (double x)
11{
12 if (__builtin_isnan (x))
13 __builtin_unreachable ();
14 x = sqrt (x);
15 if (x < -0.0)
16 link_error ();
17 use (x);
18}
19
20void
21bar (double x)
22{
23 if (!__builtin_isnan (sqrt (x)))
24 {
25 if (__builtin_isnan (x))
26 link_error ();
27 if (x < -0.0)
28 link_error ();
29 }
30}
31
32void
33stool (double x)
34{
35 double res1 = sqrt (x);
36 double res2 = __builtin_sqrt (x);
37 if (res1 < -0.0 || res2 < -0.0)
38 link_error ();
39}
40
41// { dg-final { scan-tree-dump-not "link_error" "evrp" { target { { *-*-linux* } && { glibc } } } } }