diff options
-rw-r--r-- | clang/test/Import/for-stmt/Inputs/F.cpp | 9 | ||||
-rw-r--r-- | clang/test/Import/for-stmt/test.cpp | 38 |
2 files changed, 47 insertions, 0 deletions
diff --git a/clang/test/Import/for-stmt/Inputs/F.cpp b/clang/test/Import/for-stmt/Inputs/F.cpp new file mode 100644 index 00000000000..2194c5ed1f5 --- /dev/null +++ b/clang/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/clang/test/Import/for-stmt/test.cpp b/clang/test/Import/for-stmt/test.cpp new file mode 100644 index 00000000000..a926a9f489b --- /dev/null +++ b/clang/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(); +} |