[PATCH] D50796: [ASTImporter] Add test for IfStmt

Raphael Isemann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 15 15:32:29 PDT 2018


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

Changed prior to commit:
  https://reviews.llvm.org/D50796?vs=160876&id=160930#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D50796

Files:
  lldb/trunk/test/Import/if-stmt/Inputs/F.cpp
  lldb/trunk/test/Import/if-stmt/test.cpp


Index: lldb/trunk/test/Import/if-stmt/Inputs/F.cpp
===================================================================
--- lldb/trunk/test/Import/if-stmt/Inputs/F.cpp
+++ lldb/trunk/test/Import/if-stmt/Inputs/F.cpp
@@ -0,0 +1,21 @@
+void f() {
+  if (true)
+    return;
+
+  if (int j = 3)
+    return;
+
+  if (int j; true)
+    return;
+
+  if (true)
+    return;
+  else
+    return;
+
+  if (true) {
+    return;
+  } else {
+    return;
+  }
+}
Index: lldb/trunk/test/Import/if-stmt/test.cpp
===================================================================
--- lldb/trunk/test/Import/if-stmt/test.cpp
+++ lldb/trunk/test/Import/if-stmt/test.cpp
@@ -0,0 +1,47 @@
+// RUN: clang-import-test -dump-ast -import %S/Inputs/F.cpp -expression %s | FileCheck %s
+
+// CHECK: IfStmt
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: CXXBoolLiteralExpr
+// CHECK-NEXT: ReturnStmt
+// CHECK-NEXT: <<NULL>>
+
+// CHECK: IfStmt
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: DeclStmt
+// CHECK-NEXT: VarDecl
+// CHECK-NEXT: IntegerLiteral
+// CHECK-NEXT: ImplicitCastExpr
+// CHECK-NEXT: ImplicitCastExpr
+// CHECK-NEXT: DeclRefExpr
+// CHECK-NEXT: ReturnStmt
+// CHECK-NEXT: <<NULL>>
+
+// CHECK: IfStmt
+// CHECK-NEXT: DeclStmt
+// CHECK-NEXT: VarDecl
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: CXXBoolLiteralExpr
+// CHECK-NEXT: ReturnStmt
+// CHECK-NEXT: <<NULL>>
+
+// CHECK: IfStmt
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: CXXBoolLiteralExpr
+// CHECK-NEXT: ReturnStmt
+// CHECK-NEXT: ReturnStmt
+
+// CHECK: IfStmt
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: <<NULL>>
+// CHECK-NEXT: CXXBoolLiteralExpr
+// CHECK-NEXT: CompoundStmt
+// CHECK-NEXT: ReturnStmt
+// CHECK-NEXT: CompoundStmt
+// CHECK-NEXT: ReturnStmt
+
+void expr() {
+  f();
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50796.160930.patch
Type: text/x-patch
Size: 1774 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180815/a76446ae/attachment-0001.bin>


More information about the cfe-commits mailing list