1 /* PR tree-optimization/18046  */
2 /* { dg-options "-O2 -fdump-tree-vrp" }  */
3 /* { dg-final { scan-tree-dump-times "baz \\(0\\);" 4 "vrp1" } }  */
4 
5 void foo (void);
6 void bar (void);
7 void baz (int);
8 
9 void
test(int i)10 test (int i)
11 {
12   switch (i)
13     {
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;
29     }
30 }
31