summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/vrp11.c
blob: b9e5fca71f998eee0bcd3a7dc328db49762624e8 (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, int z)
{
  if (k > z)
    {
      if (j > k)
	{
	  /* We should fold this to if (1).  */
	  if (j > z)
	    return j;
	}
    }

  return j;
}

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