aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20011223-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20011223-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20011223-1.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20011223-1.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20011223-1.c
new file mode 100644
index 000000000..18fb72089
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20011223-1.c
@@ -0,0 +1,22 @@
+/* Origin: Joseph Myers <jsm28@cam.ac.uk>. */
+/* Case labels in a switch statement are converted to the promoted
+ type of the controlling expression, not an unpromoted version.
+ Reported as PR c/2454 by
+ Andreas Krakowczyk <Andreas.Krakowczyk@fujitsu-siemens.com>. */
+
+extern void exit (int);
+extern void abort (void);
+
+static int i;
+
+int
+main (void)
+{
+ i = -1;
+ switch ((signed char) i) {
+ case 255:
+ abort ();
+ default:
+ exit (0);
+ }
+}