[ASTImporter] Add test for WhileStmt

Reviewers: a.sidorin, martong

Reviewed By: martong

Subscribers: rnkovacs, martong, cfe-commits

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

llvm-svn: 339916
This commit is contained in:
Raphael Isemann 2018-08-16 18:20:05 +00:00
parent 003140d1b2
commit 2fd6e45e67
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,8 @@
void f() {
while (false)
;
while (false) {
}
while (bool ini = true)
;
}

View File

@ -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();
}