summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2019-01-16 15:40:23 +0000
committerAaron Ballman <aaron@aaronballman.com>2019-01-16 15:40:23 +0000
commitcc980306eb914ea56ef07acfbbe297511a9c956f (patch)
tree0029a3b7e792fd20818c1d345b42f6de1f2b6e25
parent1f3d459a80db9678a3243645cc3b2fc1d6af932d (diff)
Added a test case for dumping blocks that capture 'this'; NFC.
-rw-r--r--clang/test/AST/ast-dump-decl.mm17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/AST/ast-dump-decl.mm b/clang/test/AST/ast-dump-decl.mm
index be245f7ef5c..d18e56c939d 100644
--- a/clang/test/AST/ast-dump-decl.mm
+++ b/clang/test/AST/ast-dump-decl.mm
@@ -31,3 +31,20 @@ struct BoxingTest {
};
// CHECK: ObjCBoxedExpr{{.*}} '<dependent type>'{{$}}
+
+struct Test {
+ void f() {
+ ^{ this->yada(); }();
+ // CHECK: ExprWithCleanups {{.*}} <line:[[@LINE-1]]:5, col:24> 'void'
+ // CHECK-NEXT: cleanup Block
+ // CHECK-NEXT: CallExpr {{.*}} <col:5, col:24> 'void'
+ // CHECK-NEXT: BlockExpr {{.*}} <col:5, col:22> 'void (^)()'
+ // CHECK-NEXT: BlockDecl {{.*}} <col:5, col:22> col:5
+ // CHECK-NEXT: capture this
+ // CHECK-NEXT: CompoundStmt {{.*}} <col:6, col:22>
+ // CHECK-NEXT: CXXMemberCallExpr {{.*}} <col:8, col:19> 'void'
+ // CHECK-NEXT: MemberExpr {{.*}} <col:8, col:14> '<bound member function type>' ->yada
+ // CHECK-NEXT: CXXThisExpr {{.*}} <col:8> 'Test *' this
+ }
+ void yada();
+};