OSDN Git Service

Fix PR 17408 and PR 17409.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / execute / 20011223-1.c
1 /* Origin: Joseph Myers <jsm28@cam.ac.uk>.  */
2 /* Case labels in a switch statement are converted to the promoted
3    type of the controlling expression, not an unpromoted version.
4    Reported as PR c/2454 by
5    Andreas Krakowczyk <Andreas.Krakowczyk@fujitsu-siemens.com>.  */
6
7 extern void exit (int);
8 extern void abort (void);
9
10 static int i;
11
12 int
13 main (void)
14 {
15   i = -1;
16   switch ((signed char) i) {
17   case 255:
18     abort ();
19   default:
20     exit (0);
21   }
22 }