aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/vrp107.c
blob: b74f031b1c839b544be616a0eb180f441ab4c0c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* { dg-options "-O2 -fdump-tree-vrp1" }  */
/* { dg-final { scan-tree-dump "case 2:" "vrp1" } }  */
/* { dg-final { scan-tree-dump "case 7 ... 8:" "vrp1" } }  */

extern void foo (void);
extern void bar (void);
extern void baz (void);

void
test (int i)
{
  if (i >= 2 && i <= 8)
  switch (i)
    {
    case 1: /* Redundant label.  */
    case 2:
      bar ();
      break;
    case 7:
    case 8:
    case 9: /* Redundant label.  */
      baz ();
      break;
    }
}