[PATCH] D51056: [ASTImporter] Add test for SwitchStmt
Raphael Isemann via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 22 15:48:00 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL340464: [ASTImporter] Add test for SwitchStmt (authored by teemperor, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D51056?vs=161798&id=162082#toc
Repository:
rL LLVM
https://reviews.llvm.org/D51056
Files:
cfe/trunk/test/Import/switch-stmt/Inputs/F.cpp
cfe/trunk/test/Import/switch-stmt/test.cpp
Index: cfe/trunk/test/Import/switch-stmt/Inputs/F.cpp
===================================================================
--- cfe/trunk/test/Import/switch-stmt/Inputs/F.cpp
+++ cfe/trunk/test/Import/switch-stmt/Inputs/F.cpp
@@ -0,0 +1,18 @@
+void f() {
+ switch (1) {
+ case 1:
+ case 2:
+ break;
+ }
+ switch (int varname; 1) {
+ case 1:
+ break;
+ case 2:
+ break;
+ }
+ switch (1)
+ default:
+ break;
+ switch (0)
+ ;
+}
Index: cfe/trunk/test/Import/switch-stmt/test.cpp
===================================================================
--- cfe/trunk/test/Import/switch-stmt/test.cpp
+++ cfe/trunk/test/Import/switch-stmt/test.cpp
@@ -0,0 +1,47 @@
+// RUN: clang-import-test -dump-ast -import %S/Inputs/F.cpp -expression %s | FileCheck %s
+
+// CHECK: SwitchStmt
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: IntegerLiteral
+// CHECK-NEXT: CompoundStmt
+// CHECK-NEXT: CaseStmt
+// CHECK-NEXT: IntegerLiteral
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: CaseStmt
+// CHECK-NEXT: IntegerLiteral
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: BreakStmt
+
+// CHECK: SwitchStmt
+// CHECK-NEXT: DeclStmt
+// CHECK-NEXT: VarDecl
+// CHECK-SAME: varname
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: IntegerLiteral
+// CHECK-NEXT: CompoundStmt
+// CHECK-NEXT: CaseStmt
+// CHECK-NEXT: IntegerLiteral
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: BreakStmt
+// CHECK-NEXT: CaseStmt
+// CHECK-NEXT: IntegerLiteral
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: BreakStmt
+
+// CHECK: SwitchStmt
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: IntegerLiteral
+// CHECK-NEXT: DefaultStmt
+// CHECK-NEXT: BreakStmt
+
+// CHECK: SwitchStmt
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: IntegerLiteral
+// CHECK-NEXT: NullStmt
+
+void expr() {
+ f();
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51056.162082.patch
Type: text/x-patch
Size: 1805 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180822/7bd75a7c/attachment.bin>
More information about the llvm-commits
mailing list