PR testsuite/52641
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / vrp82.c
blob8f9b2ff0544d20b06b5c188cec63bbfb89754b65
1 /* { dg-do link } */
2 /* { dg-options "-O2" } */
4 extern void link_error (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 == -5 || b == 5)
20 link_error ();
23 void
24 f3 (int s, int b)
26 if (s >> 3 == -2)
28 /* s in range [-16, -9]. */
29 b = (b & 1) + 1;
30 /* b in range [1, 2]. */
31 b = s << b;
32 /* b in range [bmin << smax, bmax << smin],
33 == [-16 << 2, -9 << 1]
34 == [-64, -18]. */
35 if (b == -65 || b == -17)
36 link_error ();
40 void
41 f4 (unsigned int s, unsigned int b)
43 s |= ~0xffU;
44 /* s in [0xffffff00, 0xffffffff]. */
45 b = (b & 1) + 1;
46 /* b in [1, 2]. */
47 b = s << b;
48 /* s in [0xfffffc00, 0xfffffffe]. */
49 if (b == ~0x3ffU - 1 || b == ~0x1U + 1)
50 link_error ();
53 int
54 main ()
56 return 0;