aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/pr53153.c
blob: 8899e04e90f642479d14a546bed53805125a587e (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* { dg-do compile } */
/* { dg-options "-O2" } */

extern void bar (void);

/* Case 181 is not in the range for 'char'.  */
void
foo1 (char *buf)
{
  int x = *buf;
  switch (x)
    {
    case -76:
    case 65:
    case 181:
      bar();
    }
}

/* All cases are below the range of char.  */
void
foo2 (char *buf)
{
  int x = *buf;
  switch (x)
    {
    case -150:
    case -140:
    case -130:
      bar();
    }
}

/* All cases are above the range of char.  */
void
foo3 (char *buf)
{
  int x = *buf;
  switch (x)
    {
    case 130:
    case 140:
    case 150: /* This case is not in the range for 'char'.  */
      bar();
    }
}

/* The bounding cases are partially out of range for char.  */
void
foo4 (char *buf)
{
  int x = *buf;
  switch (x)
    {
    case -130 ... -120:
    case 100:
    case 120 ... 130:
      bar();
    }
}