[PATCH] D50811: [ASTImporter] Add test for WhileStmt

Raphael Isemann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 16 11:20:44 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL339916: [ASTImporter] Add test for WhileStmt (authored by teemperor, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D50811?vs=160919&id=161074#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D50811

Files:
  cfe/trunk/test/Import/while-stmt/Inputs/F.cpp
  cfe/trunk/test/Import/while-stmt/test.cpp


Index: cfe/trunk/test/Import/while-stmt/Inputs/F.cpp
===================================================================
--- cfe/trunk/test/Import/while-stmt/Inputs/F.cpp
+++ cfe/trunk/test/Import/while-stmt/Inputs/F.cpp
@@ -0,0 +1,8 @@
+void f() {
+  while (false)
+    ;
+  while (false) {
+  }
+  while (bool ini = true)
+    ;
+}
Index: cfe/trunk/test/Import/while-stmt/test.cpp
===================================================================
--- cfe/trunk/test/Import/while-stmt/test.cpp
+++ cfe/trunk/test/Import/while-stmt/test.cpp
@@ -0,0 +1,23 @@
+// RUN: clang-import-test -dump-ast -import %S/Inputs/F.cpp -expression %s | FileCheck %s
+
+// CHECK: WhileStmt
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: CXXBoolLiteralExpr
+// CHECK-NEXT: NullStmt
+
+// CHECK: WhileStmt
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: CXXBoolLiteralExpr
+// CHECK-NEXT: CompoundStmt
+
+// CHECK: WhileStmt
+// CHECK-NEXT: DeclStmt
+// CHECK-NEXT: VarDecl
+// CHECK-NEXT: CXXBoolLiteralExpr
+// CHECK-NEXT: ImplicitCastExpr
+// CHECK-NEXT: DeclRefExpr
+// CHECK-NEXT: NullStmt
+
+void expr() {
+  f();
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50811.161074.patch
Type: text/x-patch
Size: 1092 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180816/8f9fc421/attachment-0001.bin>


More information about the cfe-commits mailing list