diff options
author | Raphael Isemann <teemperor@gmail.com> | 2018-08-16 01:35:47 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2018-08-16 01:35:47 +0000 |
commit | 49634ed0fd44a4b245488e77907e6145c9cea017 (patch) | |
tree | e45f309783c18ddc6d60bbbba9a8e0534c295a84 /test/Import | |
parent | 3bf779de600544a668c0a3daeedf8e2fefbb9449 (diff) | |
download | clang-49634ed0fd44a4b245488e77907e6145c9cea017.tar.gz |
[ASTImporter] Add test for ForStmt and ContinueStmt
Reviewers: a.sidorin, a_sidorin
Reviewed By: a_sidorin
Subscribers: martong, cfe-commits
Differential Revision: https://reviews.llvm.org/D50812
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339837 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Import')
-rw-r--r-- | test/Import/for-stmt/Inputs/F.cpp | 9 | ||||
-rw-r--r-- | test/Import/for-stmt/test.cpp | 38 |
2 files changed, 47 insertions, 0 deletions
diff --git a/test/Import/for-stmt/Inputs/F.cpp b/test/Import/for-stmt/Inputs/F.cpp new file mode 100644 index 0000000000..2194c5ed1f --- /dev/null +++ b/test/Import/for-stmt/Inputs/F.cpp @@ -0,0 +1,9 @@ +void f() { + for (;;) + ; + for (int i = 0;;) + continue; + for (int i = 0; i != 0; ++i) { + i++; + } +} diff --git a/test/Import/for-stmt/test.cpp b/test/Import/for-stmt/test.cpp new file mode 100644 index 0000000000..a926a9f489 --- /dev/null +++ b/test/Import/for-stmt/test.cpp @@ -0,0 +1,38 @@ +// RUN: clang-import-test -dump-ast -import %S/Inputs/F.cpp -expression %s | FileCheck %s + +// CHECK: ForStmt +// CHECK-NEXT: <<NULL>> +// CHECK-NEXT: <<NULL>> +// CHECK-NEXT: <<NULL>> +// CHECK-NEXT: <<NULL>> +// CHECK-NEXT: NullStmt + +// CHECK: ForStmt +// CHECK-NEXT: DeclStmt +// CHECK-NEXT: VarDecl +// CHECK-NEXT: IntegerLiteral +// CHECK-NEXT: <<NULL>> +// CHECK-NEXT: <<NULL>> +// CHECK-NEXT: <<NULL>> +// CHECK-NEXT: ContinueStmt + +// CHECK: ForStmt +// CHECK-NEXT: DeclStmt +// CHECK-NEXT: VarDecl +// CHECK-NEXT: IntegerLiteral +// CHECK-NEXT: <<NULL>> + +// CHECK-NEXT: BinaryOperator +// CHECK-NEXT: ImplicitCastExpr +// CHECK-NEXT: DeclRefExpr +// CHECK-NEXT: IntegerLiteral + +// CHECK-NEXT: UnaryOperator +// CHECK-SAME: '++' +// CHECK-NEXT: DeclRefExpr + +// CHECK-NEXT: CompoundStmt + +void expr() { + f(); +} |