gcc/testsuite/gcc.c-torture/execute/20011223-1.c
raw| 1 | /* Origin: Joseph Myers <[email protected]>. */ |
| 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 <[email protected]>. */ |
| 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 | } |