Debian Codegraph @

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

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-evrp" } */
3
4 #include <math.h>
5 void link_error();
6
7 void
8 test1 (double x)
9 {
10 if (x > __DBL_MAX__ && !__builtin_isinf (x))
11 link_error ();
12 if (x < -__DBL_MAX__ && !__builtin_isinf (x))
13 link_error ();
14 }
15
16 void
17 test2 (float x)
18 {
19 if (x > __FLT_MAX__ && !__builtin_isinf (x))
20 link_error ();
21 if (x < -__FLT_MAX__ && !__builtin_isinf (x))
22 link_error ();
23 }
24
25 void
26 test3 (double x)
27 {
28 if (!__builtin_isinf (x) && !__builtin_isnan (x) && x > __DBL_MAX__)
29 link_error ();
30 if (!__builtin_isinf (x) && !__builtin_isnan (x) && x < -__DBL_MAX__)
31 link_error ();
32 }
33
34 void
35 test4 (float x)
36 {
37 if (!__builtin_isinf (x) && !__builtin_isnan (x) && x > __FLT_MAX__)
38 link_error ();
39 if (!__builtin_isinf (x) && !__builtin_isnan (x) && x < -__FLT_MAX__)
40 link_error ();
41 }
42
43 /* { dg-final { scan-tree-dump-not "link_error" "evrp" } } */
44