Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / gcc.dg / vrp-overflow-1.c
blob8e5794c77b6d1091381ac7190d47496fcf818e4a
1 /* { dg-do run } */
2 /* { dg-options "-O2 -fno-tree-forwprop" } */
4 extern void __attribute__((noreturn)) unreachable (void);
6 int fle22 (int a)
8 unsigned i = a / 4;
9 unsigned j = i - 2;
11 if (j == 7) /* A dynamic range excludes a value from j for the rest of f1. */
12 return -1;
14 if (i <= 2) /* This dynamic range cannot be combined or compared with that of j. */
15 return 0;
17 if (i <= j) /* And so we couldn't compute this result. */
18 unreachable ();
20 return 1;
23 int fle32 (int a)
25 unsigned i = a / 4;
26 unsigned j = i - 3;
28 if (j == 7) /* A dynamic range excludes a value from j for the rest of f1. */
29 return -1;
31 if (i <= 2) /* This dynamic range cannot be combined or compared with that of j. */
32 return 0;
34 if (i <= j) /* And so we couldn't compute this result. */
35 unreachable ();
37 return 1;
40 int flt22 (int a)
42 unsigned i = a / 4;
43 unsigned j = i - 2;
45 if (j == 7)
46 return -1;
48 if (i <= 2)
49 return 0;
51 if (i < j)
52 unreachable ();
54 return 1;
57 int flt32 (int a)
59 unsigned i = a / 4;
60 unsigned j = i - 3;
62 if (j == 7)
63 return -1;
65 if (i <= 2)
66 return 0;
68 if (i < j)
69 unreachable ();
71 return 1;
74 int fgt22 (int a)
76 unsigned i = a / 4;
77 unsigned j = i + 2;
79 if (j == -7)
80 return -1;
82 if (i >= -3)
83 return 0;
85 if (i > j)
86 unreachable ();
88 return 1;
91 int fgt32 (int a)
93 unsigned i = a / 4;
94 unsigned j = i + 3;
96 if (j == -7)
97 return -1;
99 if (i >= -3)
100 return 0;
102 if (i > j)
103 unreachable ();
105 return 1;
108 int fge22 (int a)
110 unsigned i = a / 4;
111 unsigned j = i + 2;
113 if (j == -7)
114 return -1;
116 if (i >= -3)
117 return 0;
119 if (i >= j)
120 unreachable ();
122 return 1;
125 int fge32 (int a)
127 unsigned i = a / 4;
128 unsigned j = i + 3;
130 if (j == -7)
131 return -1;
133 if (i >= -3)
134 return 0;
136 if (i >= j)
137 unreachable ();
139 return 1;
142 int main (int argc, char *argv[]) {
143 fle22 (argc);
144 fle32 (argc);
145 flt22 (argc);
146 flt32 (argc);
147 fgt22 (argc);
148 fgt32 (argc);
149 fge22 (argc);
150 fge32 (argc);