PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / vrp65.c
blobd1090685d2e58d10b69f1aad9b88853f480f0851
1 /* PR tree-optimization/52267 */
2 /* { dg-do link } */
3 /* { dg-options "-O2" } */
5 extern void link_error (void);
7 #define BITSM1 (sizeof (int) * __CHAR_BIT__ - 1)
8 #define BITSH ((sizeof (int) - sizeof (short)) * __CHAR_BIT__)
10 void
11 f1 (unsigned int s)
13 if ((s & (7U << (BITSM1 - 2))) != 0)
15 if (s <= (1U << (BITSM1 - 2)) - 1)
16 link_error ();
18 else
20 if (s >= (1U << (BITSM1 - 2)))
21 link_error ();
25 void
26 f2 (int s)
28 if ((s & (7U << (BITSM1 - 2))) == 0)
30 if (s >= (1 << (BITSM1 - 2)) || s < 0)
31 link_error ();
33 else
35 if (s >= 0 && s <= (1 << (BITSM1 - 2)) - 1)
36 link_error ();
40 void
41 f3 (unsigned int s)
43 if ((s & 0x3cc0) == 0)
45 if (s >= -15552U)
46 link_error ();
48 else
50 if (s <= 0x3f)
51 link_error ();
55 void
56 f4 (int s)
58 if ((s & 0x3cc0) == 0)
60 if (s >= -15552 && s < 0)
61 link_error ();
63 else
65 if (/* s <= 0x3fU */ s == 0 || s == 0x20 || s == 0x3f)
66 link_error ();
70 void
71 f5 (int s)
73 if ((s & 0x3cc0U) == 0)
75 if (s >= -15552 && s < 0)
76 link_error ();
78 else
80 if (/* s <= 0x3fU */ s == 0 || s == 0x20 || s == 0x3f)
81 link_error ();
85 void
86 f6 (unsigned int s)
88 if ((s & 0x3cc0) == 0x3cc0)
90 if (s <= 0x3cbf)
91 link_error ();
93 else
95 if (s >= -64U)
96 link_error ();
100 void
101 f7 (int s)
103 if ((s & 0x3cc0) == 0x3cc0)
105 if (s >= 0 && s <= 0x3cbf)
106 link_error ();
108 else
110 if (s >= -64 && s < 0)
111 link_error ();
115 void
116 f8 (int s)
118 if ((s & 0x3cc0U) == 0x3cc0)
120 if (s >= 0 && s <= 0x3cbf)
121 link_error ();
123 else
125 if (s >= -64 && s < 0)
126 link_error ();
130 void
131 f9 (unsigned int s)
133 if ((s & 0x3cc0) >= 0x1cc0)
135 if (s <= 0x1cbf)
136 link_error ();
138 else
140 if (s >= -8256U)
141 link_error ();
145 void
146 f10 (unsigned int s)
148 if ((s & 0x3cc0) > 0x1cc0)
150 if (s <= 0x1fff)
151 link_error ();
153 else
155 if (s >= -8192U)
156 link_error ();
160 void
161 f11 (int s)
163 if ((s & 0x3cc0) >= 0x1cc0)
165 if (s >= 0 && s <= 0x1cbf)
166 link_error ();
168 else
170 if (s >= -8256 && s < 0)
171 link_error ();
175 void
176 f12 (int s)
178 if ((s & 0x3cc0) > 0x1cc0)
180 if (s >= 0 && s <= 0x1fff)
181 link_error ();
183 else
185 if (s >= -8192 && s < 0)
186 link_error ();
190 void
191 f13 (unsigned int s)
193 if ((s & (0xe071U << BITSH)) > (0xb030U << BITSH))
195 if (s <= ((0xc000U << BITSH) - 1))
196 link_error ();
198 else
200 if (s >= (0xc000U << BITSH))
201 link_error ();
205 void
206 f14 (unsigned int s)
208 if ((s & (0xe071U << BITSH)) > (0xa030U << BITSH))
210 if (s <= ((0xa031U << BITSH) - 1))
211 link_error ();
213 else
215 if (s >= (0xbfbfU << BITSH))
216 link_error ();
220 void
221 f15 (int s)
223 if ((s & ((-0x1f8f) << BITSH)) > ((-0x4fd0) << BITSH))
225 if (s <= ((-0x4000 << BITSH) - 1))
226 link_error ();
228 else
230 if (s > ((-0x4000 << BITSH) - 1))
231 link_error ();
235 void
236 f16 (int s)
238 if ((s & ((-0x1f8f) << BITSH)) >= ((-0x4fd0) << BITSH))
240 if (s <= ((-0x4000 << BITSH) - 1))
241 link_error ();
243 else
245 if (s > ((-0x4000 << BITSH) - 1))
246 link_error ();
250 void
251 f17 (int s)
253 if ((s & ((-0x4000 << BITSH) | 1)) != -__INT_MAX__ - 1)
255 if (s == -__INT_MAX__ - 1)
256 link_error ();
258 else
260 if (s >= (-0x4000 << BITSH) - 1)
261 link_error ();
265 void
266 f18 (int s)
268 if ((s & ((-0x4000 << BITSH) | 1)) != ((-0x4000 << BITSH) | 1))
270 if (s == -1)
271 link_error ();
273 else
275 if (s < ((-0x4000 << BITSH) | 1) || s >= 0)
276 link_error ();
280 void
281 f19 (int s)
283 if ((s & ((-0x4000 << BITSH) | 1)) != ((0x4000 << BITSH) | 1))
285 if (s == __INT_MAX__)
286 link_error ();
288 else
290 if (s <= (0x4000 << BITSH))
291 link_error ();
295 void
296 f20 (int s)
298 if ((s & (-0x1000 << BITSH)) != -__INT_MAX__ - 1)
300 if (s < (-0x7000 << BITSH))
301 link_error ();
303 else
305 if (s >= (-0x7000 << BITSH))
306 link_error ();
310 void
311 f21 (int s)
313 if ((s & (-0x1000 << BITSH)) != (-0x1000 << BITSH))
315 if (s >= (-0x1000 << BITSH) && s < 0)
316 link_error ();
318 else
320 if (s < (-0x1000 << BITSH) || s >= 0)
321 link_error ();
325 void
326 f22 (int s)
328 if ((s & (-0x1000 << BITSH)) != (0x7000 << BITSH))
330 if (s >= (0x7000 << BITSH))
331 link_error ();
333 else
335 if (s < (0x7000 << BITSH))
336 link_error ();
340 void
341 f23 (unsigned int s)
343 if ((s & (0xf000U << BITSH)) != (0x7000 << BITSH))
345 if (/* s >= (0x7000 << BITSH) && s < (0x8000U << BITSH) */
346 s == (0x7000 << BITSH) || s == __INT_MAX__)
347 link_error ();
349 else
351 if (s < (0x7000 << BITSH) || s >= (0x8000U << BITSH))
352 link_error ();
356 void
357 f24 (unsigned int s)
359 if ((s & (0xf000U << BITSH)) != (0x8000U << BITSH))
361 if (/* s >= (0x8000U << BITSH) && s < (0x9000U << BITSH) */
362 s == (0x8000U << BITSH) || s == (0x9000U << BITSH) - 1)
363 link_error ();
365 else
367 if (s >= (0x9000U << BITSH) || s < (0x8000U << BITSH))
368 link_error ();
373 main ()
375 return 0;