merge with trunk @ 139506
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-dce-3.c
blobf7645c353def3f265e337428fac0e53b787f54e9
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-cddce1" } */
4 int main(void)
6 unsigned i, j;
8 for (i = 1, j = 0; i != 0; i+=2)
10 j += 500;
11 if (j % 7)
13 j++;
15 else
17 j--;
21 return 0;
24 /* We should eliminate the inner condition, but the loop must be preserved
25 as it is infinite. Therefore there should be just one phi node (for i): */
26 /* { dg-final { scan-tree-dump-times "PHI " 1 "cddce1"} } */
28 /* And one if (for the exit condition of the loop): */
29 /* { dg-final { scan-tree-dump-times "if " 1 "cddce1"} } */
31 /* { dg-final { cleanup-tree-dump "cddce1" } } */