summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/test22999.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/fail_compilation/test22999.d')
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/test22999.d27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test22999.d b/gcc/testsuite/gdc.test/fail_compilation/test22999.d
new file mode 100644
index 00000000000..99dfe70378b
--- /dev/null
+++ b/gcc/testsuite/gdc.test/fail_compilation/test22999.d
@@ -0,0 +1,27 @@
+/*
+REQUIRED_ARGS: -de
+TEST_OUTPUT:
+---
+fail_compilation/test22999.d(18): Deprecation: switch case fallthrough - use 'goto default;' if intended
+fail_compilation/test22999.d(25): Deprecation: switch case fallthrough - use 'goto case;' if intended
+---
+*/
+
+// no switch fallthrough error with multi-valued case
+// https://issues.dlang.org/show_bug.cgi?id=22999
+void main()
+{
+ int i;
+ switch (0)
+ {
+ case 0, 1: i = 20;
+ default: assert(0);
+ }
+
+ switch (0)
+ {
+ default:
+ case 0, 1: i = 20;
+ case 2, 3: i = 30;
+ }
+}