re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 ...
[gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / vrp11.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-vrp1 -fno-early-inlining" } */
3
4 inline int
5 bounce (int arg)
6 {
7 return arg;
8 }
9
10 foo (int k, int j, int z)
11 {
12 if (k > z)
13 {
14 if (j > k)
15 {
16 /* We should fold this to if (1). */
17 if (j > bounce (z))
18 return j;
19 }
20 }
21
22 return j+1;
23 }
24
25 /* { dg-final { scan-tree-dump-times "Folding predicate.*to 1" 1 "vrp1" } } */
26 /* { dg-final { cleanup-tree-dump "vrp1" } } */