[AST] Check that GNU range case statements are correctly imported.

The test for case statements did not cover GNU range case statements.

Differential Revision: https://reviews.llvm.org/D53610

Reviewed By: rjmccall

llvm-svn: 345506
This commit is contained in:
Bruno Ricci 2018-10-29 15:04:19 +00:00
parent 6ab5bb115a
commit 635d49e1df
2 changed files with 16 additions and 0 deletions

View File

@ -3,12 +3,17 @@ void f() {
case 1:
case 2:
break;
case 3 ... 4:
case 5 ... 5:
break;
}
switch (int varname; 1) {
case 1:
break;
case 2:
break;
case 3 ... 5:
break;
}
switch (1)
default:

View File

@ -10,6 +10,13 @@
// CHECK-NEXT: CaseStmt
// CHECK-NEXT: IntegerLiteral
// CHECK-NEXT: BreakStmt
// CHECK-NEXT: CaseStmt
// CHECK-NEXT: IntegerLiteral
// CHECK-NEXT: IntegerLiteral
// CHECK-NEXT: CaseStmt
// CHECK-NEXT: IntegerLiteral
// CHECK-NEXT: IntegerLiteral
// CHECK-NEXT: BreakStmt
// CHECK: SwitchStmt
// CHECK-NEXT: DeclStmt
@ -24,6 +31,10 @@
// CHECK-NEXT: CaseStmt
// CHECK-NEXT: IntegerLiteral
// CHECK-NEXT: BreakStmt
// CHECK-NEXT: CaseStmt
// CHECK-NEXT: IntegerLiteral
// CHECK-NEXT: IntegerLiteral
// CHECK-NEXT: BreakStmt
// CHECK: SwitchStmt
// CHECK-NEXT: <<NULL>>