diff options
Diffstat (limited to 'tests/diagnostics/switch-multiple-defaults.slang')
| -rw-r--r-- | tests/diagnostics/switch-multiple-defaults.slang | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/diagnostics/switch-multiple-defaults.slang b/tests/diagnostics/switch-multiple-defaults.slang new file mode 100644 index 000000000..bf164dd57 --- /dev/null +++ b/tests/diagnostics/switch-multiple-defaults.slang @@ -0,0 +1,14 @@ +//TEST:SIMPLE(filecheck=CHECK): + +// Test to evaluate the behavior of unreachable code blocks within a switch statement. A switch statement with multiple default cases is not allowed and should throw an error + +void test() +{ + switch (0) + { + default: break; + // CHECK: ([[# @LINE+1]]): error 30600: {{.*}} + default: break; + } + return; +} |
