summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/switch2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/opt/switch2.C')
-rw-r--r--gcc/testsuite/g++.dg/opt/switch2.C23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/opt/switch2.C b/gcc/testsuite/g++.dg/opt/switch2.C
new file mode 100644
index 000000000..f7374cb74
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/switch2.C
@@ -0,0 +1,23 @@
+// { dg-do compile }
+// { dg-options "-O2 -w" }
+
+extern int foo (int);
+
+void
+bar (void)
+{
+ char tmp = foo (0);
+ switch (tmp)
+ {
+ case 1: foo (1); break;
+ case 2: foo (2); break;
+ case 3: foo (3); break;
+ case 4: foo (4); break;
+ case 5: foo (5); break;
+ case 6: foo (6); break;
+ case 7: foo (7); break;
+ case 255: foo (8); break;
+ default: break;
+ }
+}
+