blob: 8f5f86021c85e8775fb2cd2161f6b319bae2726c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* { dg-do compile } */
/* { dg-options "-O2 -fdisable-tree-evrp -fdump-tree-vrp1 -fno-thread-jumps" } */
int baz (void);
int
foo (int i, int j, int a)
{
if (i >= 10)
if (i <= 30)
if (i == j)
{
a--;
/* This should fold to 'if (0)'. */
if (i < 0)
i = baz ();
/* This should fold to 'if (1)'. */
if (j > 0)
a--;
/* This should fold to 'if (0)'. */
if (i != j)
return 0;
}
return i + a + j;
}
/* { dg-final { scan-tree-dump-times "Folding predicate \[i|j\]_\[0-9\]+.*0 to 0" 1 "vrp1" } } */
/* { dg-final { scan-tree-dump-times "Folding predicate \[i|j\]_\[0-9\]+.*0 to 1" 1 "vrp1" } } */
/* { dg-final { scan-tree-dump-times "Folding predicate i_\[0-9]+.*j_\[0-9\]+.* to 0" 1 "vrp1" { xfail *-*-* } } } */
|