111
|
1 /* { dg-do compile } */
|
|
2 /* { dg-options "-O2 -fdump-tree-vrp1" } */
|
|
3
|
|
4 extern void link_error (void);
|
|
5
|
|
6 unsigned foo (unsigned i)
|
|
7 {
|
|
8 if (i == 2)
|
|
9 {
|
|
10 i = i << 2;
|
|
11 if (i != 8)
|
|
12 link_error ();
|
|
13 }
|
|
14 return i;
|
|
15 }
|
|
16 unsigned bar (unsigned i)
|
|
17 {
|
|
18 if (i == 1 << (sizeof (unsigned) * 8 - 1))
|
|
19 {
|
|
20 i = i << 1;
|
|
21 if (i != 0)
|
|
22 link_error ();
|
|
23 }
|
|
24 return i;
|
|
25 }
|
|
26 unsigned baz (unsigned i)
|
|
27 {
|
|
28 i = i & 15;
|
|
29 if (i == 0)
|
|
30 return 0;
|
|
31 i = 1000 - i;
|
|
32 i >>= 1;
|
|
33 i <<= 1;
|
|
34 if (i == 0)
|
|
35 link_error ();
|
|
36 return i;
|
|
37 }
|
|
38
|
|
39 /* { dg-final { scan-tree-dump-times "if" 3 "vrp1" } } */
|