summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/test22999.d
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2022-04-29 17:54:39 +0100
committerIain Sandoe <iain@sandoe.co.uk>2022-04-29 17:54:39 +0100
commit3e5f7ca352c26a222bb588741b7c700a3052a372 (patch)
tree283aec084274668fe34c23c49ab2999390ed9778 /gcc/testsuite/gdc.test/fail_compilation/test22999.d
parent2ce0608ca3dca30518bec525c435f7bc4d7f9b70 (diff)
parentb85e79dce149df68b92ef63ca2a40ff1dfa61396 (diff)
downloadgcc-devel/c++-coroutines.tar.gz
Merge master r12-8312.devel/c++-coroutines
* Merge master r12-8312-gb85e79dce149.
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;
+ }
+}