Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/range-sincos.c

raw
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 = sin (x);
15 if (x < -1.0 || x > 1.0)
16 link_error ();
17 use (x);
18 }
19
20 void
21 bar (double x)
22 {
23 if (!__builtin_isnan (sin (x)))
24 {
25 if (__builtin_isnan (x))
26 link_error ();
27 if (__builtin_isinf (x))
28 link_error ();
29 }
30 }
31
32 void
33 stool (double x)
34 {
35 double res1 = sin (x);
36 double res2 = __builtin_sin (x);
37 if (res1 < -1.0 || res2 < -1.0)
38 link_error ();
39 if (res1 > 1.0 || res2 > 1.0)
40 link_error ();
41 }
42
43 // { dg-final { scan-tree-dump-not "link_error" "evrp" { target { { *-*-linux* } && { glibc } } } } }