2018-03-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr53153.c
blob8899e04e90f642479d14a546bed53805125a587e
1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
4 extern void bar (void);
6 /* Case 181 is not in the range for 'char'. */
7 void
8 foo1 (char *buf)
10 int x = *buf;
11 switch (x)
13 case -76:
14 case 65:
15 case 181:
16 bar();
20 /* All cases are below the range of char. */
21 void
22 foo2 (char *buf)
24 int x = *buf;
25 switch (x)
27 case -150:
28 case -140:
29 case -130:
30 bar();
34 /* All cases are above the range of char. */
35 void
36 foo3 (char *buf)
38 int x = *buf;
39 switch (x)
41 case 130:
42 case 140:
43 case 150: /* This case is not in the range for 'char'. */
44 bar();
48 /* The bounding cases are partially out of range for char. */
49 void
50 foo4 (char *buf)
52 int x = *buf;
53 switch (x)
55 case -130 ... -120:
56 case 100:
57 case 120 ... 130:
58 bar();