PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / vrp103.c
blob2d63fc89f7a69243b9a3276f1a6de48b391b922f
1 /* PR tree-optimization/18046 */
2 /* { dg-options "-O2 -fdump-tree-vrp" } */
3 /* { dg-final { scan-tree-dump-times "baz \\(0\\);" 4 "vrp1" } } */
5 void foo (void);
6 void bar (void);
7 void baz (int);
9 void
10 test (int i)
12 switch (i)
14 case 1:
15 case 2:
16 case 3:
17 foo ();
18 break;
19 case 5:
20 bar ();
21 break;
22 default:
23 /* These tests should be folded to 0, resulting in 4 calls of baz(0). */
24 baz (i == 1);
25 baz (i == 2);
26 baz (i == 3);
27 baz (i == 5);
28 break;