blob: efe356886a93b346b52912b3c4ef6689ae7d7760 [file] [log] [blame]
Alexander Kornienko90ff6072012-12-20 02:09:13 +00001// RUN: %clang_cc1 -Wno-unused -fblocks -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s
2
3@interface A
4@end
5
6@interface TestObjCImplementation : A
7@end
8
9@implementation TestObjCImplementation : A {
10 struct X {
11 int i;
12 } X;
13}
14- (void) foo {
15}
16@end
17// CHECK: ObjCImplementationDecl{{.*}} TestObjCImplementation
18// CHECK-NEXT: super ObjCInterface{{.*}} 'A'
19// CHECK-NEXT: ObjCInterface{{.*}} 'TestObjCImplementation'
20// CHECK-NEXT: CXXCtorInitializer{{.*}} 'X'
21// CHECK-NEXT: CXXConstructExpr
22// CHECK-NEXT: ObjCIvarDecl{{.*}} X
23// CHECK-NEXT: ObjCMethodDecl{{.*}} foo
Richard Trieu4b259c82016-06-09 22:03:04 +000024
25// @() boxing expressions.
26template <typename T>
27struct BoxingTest {
28 static id box(T value) {
29 return @(value);
30 }
31};
32
33// CHECK: ObjCBoxedExpr{{.*}} '<dependent type>'{{$}}
Aaron Ballmance0fd1d2019-01-16 15:40:23 +000034
35struct Test {
36 void f() {
37 ^{ this->yada(); }();
38 // CHECK: ExprWithCleanups {{.*}} <line:[[@LINE-1]]:5, col:24> 'void'
39 // CHECK-NEXT: cleanup Block
40 // CHECK-NEXT: CallExpr {{.*}} <col:5, col:24> 'void'
41 // CHECK-NEXT: BlockExpr {{.*}} <col:5, col:22> 'void (^)()'
Stephen Kelly5110ebd2019-01-18 21:55:24 +000042 // CHECK-NEXT: BlockDecl {{.*}} <col:5, col:22> col:5 captures_this
Aaron Ballmance0fd1d2019-01-16 15:40:23 +000043 // CHECK-NEXT: CompoundStmt {{.*}} <col:6, col:22>
44 // CHECK-NEXT: CXXMemberCallExpr {{.*}} <col:8, col:19> 'void'
45 // CHECK-NEXT: MemberExpr {{.*}} <col:8, col:14> '<bound member function type>' ->yada
46 // CHECK-NEXT: CXXThisExpr {{.*}} <col:8> 'Test *' this
47 }
48 void yada();
49};