gcc/testsuite/gcc.dg/tree-ssa/vrp11.c
raw| 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 | int |
| 11 | foo (int k, int j, int z) |
| 12 | { |
| 13 | if (k > z) |
| 14 | { |
| 15 | if (j > k) |
| 16 | { |
| 17 | /* We should fold this to if (1). */ |
| 18 | if (j > bounce (z)) |
| 19 | return j; |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | return j+1; |
| 24 | } |
| 25 | |
| 26 | /* { dg-final { scan-tree-dump-times "Folding predicate.*to 1" 1 "vrp1" } } */ |