Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / vrp06.c
bloba872bc4373123a8d40878dc9afbf0df40e484f20
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdisable-tree-evrp -fdump-tree-vrp1" } */
4 int baz (void);
6 int
7 foo (int i, int j, int a)
9 if (i >= 10)
10 if (i <= 30)
11 if (i == j)
13 a--;
15 /* This should fold to 'if (0)'. */
16 if (i < 0)
17 i = baz ();
19 /* This should fold to 'if (1)'. */
20 if (j > 0)
21 a--;
23 /* This should fold to 'if (0)'. */
24 if (i != j)
25 return 0;
28 return i + a + j;
31 /* { dg-final { scan-tree-dump-times "Folding predicate \[i|j\]_\[0-9\]+.*0 to 0" 1 "vrp1" } } */
32 /* { dg-final { scan-tree-dump-times "Folding predicate \[i|j\]_\[0-9\]+.*0 to 1" 1 "vrp1" } } */
33 /* { dg-final { scan-tree-dump-times "Folding predicate i_\[0-9]+.*j_\[0-9\]+.* to 0" 1 "vrp1" } } */