]>
Commit | Line | Data |
---|---|---|
ba39d2be JJ |
1 | // { dg-do compile } |
2 | // { dg-options "-O2 -fdump-tree-evrp -fno-thread-jumps" } | |
3 | ||
4 | #include <math.h> | |
5 | ||
6 | void use (double); | |
7 | void link_error (); | |
8 | ||
9 | void | |
10 | foo (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 | ||
20 | void | |
21 | bar (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 | ||
32 | void | |
33 | stool (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 } } } } } |