[ASTImporter] Add test for DoStmt
authorRaphael Isemann <teemperor@gmail.com>
Thu, 16 Aug 2018 18:20:52 +0000 (18:20 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Thu, 16 Aug 2018 18:20:52 +0000 (18:20 +0000)
Reviewers: a.sidorin, martong

Reviewed By: martong

Subscribers: rnkovacs, martong, cfe-commits

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

llvm-svn: 339917

clang/test/Import/do-stmt/Inputs/F.cpp [new file with mode: 0644]
clang/test/Import/do-stmt/test.cpp [new file with mode: 0644]

diff --git a/clang/test/Import/do-stmt/Inputs/F.cpp b/clang/test/Import/do-stmt/Inputs/F.cpp
new file mode 100644 (file)
index 0000000..a58efb3
--- /dev/null
@@ -0,0 +1,7 @@
+void f() {
+  do
+    ;
+  while (true);
+  do {
+  } while (false);
+}
diff --git a/clang/test/Import/do-stmt/test.cpp b/clang/test/Import/do-stmt/test.cpp
new file mode 100644 (file)
index 0000000..8b1057d
--- /dev/null
@@ -0,0 +1,15 @@
+// RUN: clang-import-test -dump-ast -import %S/Inputs/F.cpp -expression %s | FileCheck %s
+
+// CHECK: DoStmt
+// CHECK-NEXT: NullStmt
+// CHECK-NEXT: CXXBoolLiteralExpr
+// CHECK-SAME: true
+
+// CHECK: DoStmt
+// CHECK-NEXT: CompoundStmt
+// CHECK-NEXT: CXXBoolLiteralExpr
+// CHECK-SAME: false
+
+void expr() {
+  f();
+}