summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/dce-1.c
blob: 42d9407e2901ff891d04ea23eefa4ed9926d4e01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-cddce1" } */
int foo (int b, int j)
{
  if (b)
    {
      int i;
      for (i = 0; i<1000; ++i)
        ;
      j = 0;
    }
  return j;
}
/* Check that empty loop is eliminated in this case.  We should no longer have
   the exit condition after the loop.  */
/* { dg-final { scan-tree-dump-not "999" "cddce1"} } */
/* { dg-final { scan-tree-dump-not "1000" "cddce1"} } */