Add qdf24xx base tuning support.
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / vrp83.c
blobdb05d2290bfe7253a85e50121351a78e461b7e27
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-vrp1" } */
4 extern void vrp_keep (void);
6 void
7 f2 (int c, int b)
9 int s = 0;
10 if (c == 0)
11 s += 1;
12 else if (c < 1)
13 s -= 1;
14 /* s in [-1, 1]. */
15 b = (b & 1) + 1;
16 /* b in range [1, 2]. */
17 b = s << b;
18 /* b in range [-4, 4]. */
19 if (b == -4)
20 vrp_keep ();
21 if (b == 4)
22 vrp_keep ();
25 void
26 f3 (int s, int b)
28 if (s >> 3 == -2)
30 /* s in range [-16, -9]. */
31 b = (b & 1) + 1;
32 /* b in range [1, 2]. */
33 b = s << b;
34 /* b in range [bmin << smax, bmax << smin],
35 == [-16 << 2, -9 << 1]
36 == [-64, -18]. */
37 if (b == -64)
38 vrp_keep ();
39 if (b == -18)
40 vrp_keep ();
44 void
45 f4 (unsigned int s, unsigned int b)
47 s |= ~(0xffU);
48 /* s in [0xffffff00, 0xffffffff]. */
49 b = (b & 1) + 1;
50 /* b in [1, 2]. */
51 b = s << b;
52 /* s in [0xfffffc00, 0xfffffffe]. */
53 if (b == ~0x3ffU)
54 vrp_keep ();
55 if (b == ~0x1U)
56 vrp_keep ();
59 /* { dg-final { scan-tree-dump-times "vrp_keep \\(" 6 "vrp1"} } */