summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/switch-9.c
blob: 2ae89d09518c1dc8f3d0686d2c13a07085579c9f (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
/* PR middle-end/18859 */
/* { dg-do compile } */
/* { dg-options "" } */

void foo(int a)
{
  switch (a)
  {
    case 0 ... -1:  /* { dg-warning "empty range" } */
      a = a+2;
      break;

    case 1 ... 2:
      a = 0;
      break;

    case 3 ... 4:
      a = 1;
      break;

    case 5 ... 6:
      a = 0;
      break;
  }
}