* tree-loop-distribution.c (INCLUDE_ALGORITHM): New header file.
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / vrp08.c
blobc2da30b4b68d1acc110af2d030a7539f4999c7ac
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fno-tree-fre -fdisable-tree-evrp -fdump-tree-vrp1-details -fdelete-null-pointer-checks" } */
4 /* Compile with -fno-tree-fre -O2 to prevent CSEing *p. */
5 int
6 foo (int a, int *p)
8 int x = *p + 2;
9 int y = *p - 1;
10 int z = *p + 9;
12 /* This should be folded to if (1), but only one ASSERT_EXPR should
13 be inserted. */
14 if (p)
15 a = x + y + z;
16 else
17 a = x - y;
19 return a;
21 /* Target disabling -fdelete-null-pointer-checks should not fold checks */
22 /* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
23 /* { dg-final { scan-tree-dump-times "PREDICATE: p_.* ne_expr 0" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
24 /* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */