merge with trunk @ 139506
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-ccp-14.c
blob3be025f079fb60f07af3da92f77ec419dcec38fa
1 /* PR tree-optimization/29738. We used not to realize that "i" can never
2 become nonzero. */
4 /* { dg-do compile } */
5 /* { dg-options "-O2 -fdump-tree-optimized" } */
7 int i;
9 void foo (void);
10 void bar (void)
12 int j;
13 i = 0;
14 for (j = 0; j < 10000; j++)
15 if (i)
16 foo ();
19 /* Everything except for the "i = 0" assignment should get removed. */
20 /* { dg-final { scan-tree-dump-times "if" 0 "optimized" { xfail *-*-* } } } */
21 /* { dg-final { cleanup-tree-dump "optimized" } } */