]> granicus.if.org Git - clang/commitdiff
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339917 91177308-0d34-0410-b5e6-96231b3b80d8

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

diff --git a/test/Import/do-stmt/Inputs/F.cpp b/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/test/Import/do-stmt/test.cpp b/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();
+}