[PATCH] D50812: [ASTImporter] Add test for ForStmt and ContinueStmt
Raphael Isemann via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 15 18:36:36 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL339837: [ASTImporter] Add test for ForStmt and ContinueStmt (authored by teemperor, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D50812?vs=160921&id=160965#toc
Repository:
rL LLVM
https://reviews.llvm.org/D50812
Files:
cfe/trunk/test/Import/for-stmt/Inputs/F.cpp
cfe/trunk/test/Import/for-stmt/test.cpp
Index: cfe/trunk/test/Import/for-stmt/Inputs/F.cpp
===================================================================
--- cfe/trunk/test/Import/for-stmt/Inputs/F.cpp
+++ cfe/trunk/test/Import/for-stmt/Inputs/F.cpp
@@ -0,0 +1,9 @@
+void f() {
+ for (;;)
+ ;
+ for (int i = 0;;)
+ continue;
+ for (int i = 0; i != 0; ++i) {
+ i++;
+ }
+}
Index: cfe/trunk/test/Import/for-stmt/test.cpp
===================================================================
--- cfe/trunk/test/Import/for-stmt/test.cpp
+++ cfe/trunk/test/Import/for-stmt/test.cpp
@@ -0,0 +1,38 @@
+// RUN: clang-import-test -dump-ast -import %S/Inputs/F.cpp -expression %s | FileCheck %s
+
+// CHECK: ForStmt
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: NullStmt
+
+// CHECK: ForStmt
+// CHECK-NEXT: DeclStmt
+// CHECK-NEXT: VarDecl
+// CHECK-NEXT: IntegerLiteral
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: ContinueStmt
+
+// CHECK: ForStmt
+// CHECK-NEXT: DeclStmt
+// CHECK-NEXT: VarDecl
+// CHECK-NEXT: IntegerLiteral
+// CHECK-NEXT: <<NULL>>
+
+// CHECK-NEXT: BinaryOperator
+// CHECK-NEXT: ImplicitCastExpr
+// CHECK-NEXT: DeclRefExpr
+// CHECK-NEXT: IntegerLiteral
+
+// CHECK-NEXT: UnaryOperator
+// CHECK-SAME: '++'
+// CHECK-NEXT: DeclRefExpr
+
+// CHECK-NEXT: CompoundStmt
+
+void expr() {
+ f();
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50812.160965.patch
Type: text/x-patch
Size: 1403 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180816/82b4f707/attachment.bin>
More information about the llvm-commits
mailing list