diff options
Diffstat (limited to 'test/Parser/switch-recovery.cpp')
-rw-r--r-- | test/Parser/switch-recovery.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Parser/switch-recovery.cpp b/test/Parser/switch-recovery.cpp index 0e4dcfa..a1df4261 100644 --- a/test/Parser/switch-recovery.cpp +++ b/test/Parser/switch-recovery.cpp @@ -156,3 +156,17 @@ void test12(int x) { } } } + +void missing_statement_case(int x) { + switch (x) { + case 1: + case 0: // expected-error {{label at end of compound statement: expected statement}} + } +} + +void missing_statement_default(int x) { + switch (x) { + case 0: + default: // expected-error {{label at end of compound statement: expected statement}} + } +} |