Clang Project

clang_source_code/test/AST/ast-dump-decl.mm
1// 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
24
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>'{{$}}
34
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 (^)()'
42    // CHECK-NEXT:       BlockDecl {{.*}} <col:5, col:22> col:5 captures_this
43    // 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};
50