OSDN Git Service

2010-01-21 Martin Jambor <mjambor@suse.cz>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / vrp05.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-vrp1 -fno-early-inlining" } */
3
4
5 inline int ten()
6 {
7   return 10;
8 }
9 inline int zero()
10 {
11   return 0;
12 }
13
14 foo (int k, int j)
15 {
16   if (k >= ten())
17     {
18       if (j > k)
19         {
20           /* We should fold this to if (1).  */
21           if (j > zero())
22             return j;
23         }
24     }
25
26   return j+1;
27 }
28
29 /* { dg-final { scan-tree-dump-times "Folding predicate j_.*to 1" 1 "vrp1" } } */
30 /* { dg-final { cleanup-tree-dump "vrp1" } } */