[multiple changes]
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / vrp08.c
blob5268e181c2c453d65ed78fe40ab1d07a437b6ebd
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fno-tree-fre -fdump-tree-vrp1-details" } */
4 /* Compile with -fno-tree-fre -O2 to prevent CSEing *p. */
5 foo (int a, int *p)
7 int x = *p + 2;
8 int y = *p - 1;
9 int z = *p + 9;
11 /* This should be folded to if (1), but only one ASSERT_EXPR should
12 be inserted. */
13 if (p)
14 a = x + y + z;
15 else
16 a = x - y;
18 return a;
21 /* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" } } */
22 /* { dg-final { scan-tree-dump-times "PREDICATE: p_.* ne_expr 0" 1 "vrp1" } } */
23 /* { dg-final { cleanup-tree-dump "vrp1" } } */