Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gcc.dg / tree-ssa / ssa-ccp-1.c
blobd662ef6e35b9c351a2fa1b3d28d4765070c319e1
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-store_ccp" } */
4 extern void link_error (void);
6 /* check folding */
8 void test1 (void)
10 unsigned int l = 3 * 4 - 5 / 2;
11 if (l != 10)
12 link_error ();
15 void test11 (void)
17 unsigned int l = (((((((3 / 2 + 2) * 4) & 7) ^ 3) % 8) << 2) + 1) >> 2;
18 if (l != 7)
19 link_error ();
22 /* cprop in a basic block */
23 void test111 (void)
25 unsigned int l0 = 3 / 2 + 2;
26 unsigned int l1 = l0 * 4;
27 unsigned int l2 = 7;
28 unsigned int l3 = l1 & l2;
29 unsigned int l4 = 3;
30 unsigned int l5 = l3 ^ l4;
31 unsigned int l6 = 8;
32 unsigned int l7 = l5 % l6;
33 unsigned int l8 = 2;
34 unsigned int l9 = l7 << l8;
35 unsigned int l10 = l9 + 1;
36 unsigned int l11 = l10 >> 2;
37 if (l11 != 7)
38 link_error ();
42 /* cprop after an if statement */
43 void test1111 (int p)
45 int l = 53;
46 if (p)
48 if ((67 + l - 25) != 95)
49 link_error ();
51 else
53 if ((93 - l + 25) != 65)
54 link_error ();
58 /* cprop after a loop */
59 void test11111 (int p, int q, int r)
61 int l = 53;
62 while (p < r)
64 if ((67 + l - 25) != 95)
65 link_error ();
66 p -= q;
72 /* There should be not link_error calls, if there is any the
73 optimization has failed */
74 /* { dg-final { scan-tree-dump-times "link_error" 0 "store_ccp"} } */
75 /* { dg-final { cleanup-tree-dump "store_ccp" } } */