PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / vrp119.c
blob92c490e542ce3dc0633ca1159784d5b8dc7bc118
1 /* PR tree-optimization/86231 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-vrp1" } */
4 /* { dg-final { scan-tree-dump-not "link_error" "vrp1" } } */
6 int bar (int);
7 void link_error (void);
9 int
10 foo (int x, int y, int z)
12 if (x < 4 || x > 8) __builtin_unreachable ();
13 if (y >= 2 && y <= 6) __builtin_unreachable ();
14 /* x is [4, 8], y is ~[2, 6], resulting range of e should be ~[2, 3]. */
15 int e = (z ? x : y);
16 bar (bar (bar (bar (bar (bar (bar (bar (bar (bar (bar (bar (e))))))))))));
17 if (e == 2 || e == 3)
18 link_error ();
19 return e;