aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/vrp05.c
blob: 767d3e1dead145d42e78171b013327b545f04b73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-vrp" } */

foo (int k, int j)
{
  if (k >= 10)
    {
      if (j > k)
	{
	  /* We should fold this to if (1).  */
	  if (j > 0)
	    return j;
	}
    }

  return j;
}

/* { dg-final { scan-tree-dump-times "Folding predicate j_.*to 1" 1 "vrp" } } */
/* { dg-final { cleanup-tree-dump "vrp" } } */