2018-04-30 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / vrp01.c
blob64320736de83fda6533f209852db0b3c59b33d0f
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-vrp1 -fdisable-tree-ethread" } */
4 int
5 foo (int *p, int i)
7 int x;
9 if (i > 10)
11 if (p)
13 x = *p;
14 p = 0;
17 else
18 p = 0;
20 /* This should be folded to if (1), but only if we insert an
21 assertion on the ELSE edge from the inner 'if (p)'. */
22 if (p == 0)
23 return x + 1;
25 return i;
28 /* { dg-final { scan-tree-dump-times "if \\\(" 2 "vrp1" } } */