Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / vrp51.c
blob94b29766a4509aebb5b47b06475573138bfb6080
1 /* PR tree-optimization/28632 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -ftree-vrp -fno-tree-ccp" } */
4 /* { dg-require-effective-target int32plus } */
6 void
7 v4 (unsigned a, unsigned b)
9 if (a < 0x1000) return;
10 if (a > 0x1000) return;
11 if (b < 0x0110) return;
12 /* constant true. */
13 if (!__builtin_constant_p ((a|b) >= 0x01000))
14 __asm__("vrp.bug.always.true");
15 /* VRP must not think that this is constant. */
16 if (__builtin_constant_p ((a|b) >= 0x10000))
17 __asm__("vrp.bug.not.always.true");
20 void
21 u4 (unsigned n)
23 if (n > 0x10111) return;
24 if (n < 0x10101) return;
25 /* always true. */
26 if (!__builtin_constant_p (n & 0x00100))
27 __asm__("vrp.bug.always.true");
28 /* VRP must not think that this is constant true. */
29 if (__builtin_constant_p (n & 0x00001))
30 __asm__("vrp.bug.not.always.true");
31 /* Out of range, always evaluates to constant false. */
32 if (!__builtin_constant_p (n & 0x01000))
33 __asm__("vrp.bug.always.false");
36 void
37 u5 (unsigned n)
39 struct s {unsigned exp:8;} x;
40 x.exp = n;
41 if (__builtin_constant_p(((n + 1) & 255) > 1))
42 __asm__("vrp.bug.not.always.true");
45 void
46 v5 (int a, int b)
48 if (a < 0x1000) return;
49 if (a > 0x1000) return;
50 if (b < 0x0110) return;
51 /* constant true. */
52 if (!__builtin_constant_p ((a|b) >= 0x01000))
53 __asm__("vrp.bug.always.true");
54 /* VRP must not think that this is always true. */
55 if (__builtin_constant_p ((a|b) >= 0x10000))
56 __asm__("vrp.bug.not.always.true");
59 /* { dg-final { scan-assembler-not "vrp\\\.bug\\\." } } */