88 lines · plain
1// Test without serialization:2// RUN: %clang_cc1 -Wno-unused -fblocks -ast-dump -ast-dump-filter Test %s \3// RUN: | FileCheck --strict-whitespace %s4// RUN: %clang_cc1 -Wno-unused -fblocks -ast-dump -triple i386-windows-pc -ast-dump-filter Test %s \5// RUN: | FileCheck --strict-whitespace %s6//7// Test with serialization:8// RUN: %clang_cc1 -Wno-unused -fblocks -emit-pch -o %t %s9// RUN: %clang_cc1 -x objective-c++ -Wno-unused -fblocks -include-pch %t \10// RUN: -ast-dump-all -ast-dump-filter Test /dev/null \11// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \12// RUN: | FileCheck --strict-whitespace %s13 14@interface A15@end16 17@interface TestObjCImplementation : A18@end19 20@implementation TestObjCImplementation : A {21 struct X {22 int i;23 } X;24}25- (void) foo {26}27@end28// CHECK: ObjCImplementationDecl{{.*}} TestObjCImplementation29// CHECK-NEXT: super ObjCInterface{{.*}} 'A'30// CHECK-NEXT: ObjCInterface{{.*}} 'TestObjCImplementation'31// CHECK-NEXT: CXXCtorInitializer{{.*}} 'X'32// CHECK-NEXT: CXXConstructExpr33// CHECK-NEXT: CXXRecordDecl{{.*}} struct X definition34// CHECK-NEXT: DefinitionData35// CHECK-NEXT: DefaultConstructor36// CHECK-NEXT: CopyConstructor37// CHECK-NEXT: MoveConstructor38// CHECK-NEXT: CopyAssignment39// CHECK-NEXT: MoveAssignment40// CHECK-NEXT: Destructor41// CHECK-NEXT: CXXRecordDecl{{.*}} struct X42// CHECK-NEXT: FieldDecl{{.*}} i 'int'43// CHECK-NEXT: CXXConstructorDecl{{.*}} 'void ()44// CHECK-NEXT: CompoundStmt45// CHECK-NEXT: CXXConstructorDecl{{.*}} 'void (const X &)46// CHECK-NEXT: ParmVarDecl{{.*}} 'const X &'47// CHECK-NEXT: CXXConstructorDecl{{.*}} 'void (X &&)48// CHECK-NEXT: ParmVarDecl{{.*}} 'X &&'49// CHECK-NEXT: CXXDestructorDecl50// CHECK-NEXT: ObjCIvarDecl{{.*}} X51// CHECK-NEXT: ObjCMethodDecl{{.*}} foo52 53// @() boxing expressions.54template <typename T>55struct BoxingTest {56 static id box(T value) {57 return @(value);58 }59};60 61// CHECK: ObjCBoxedExpr{{.*}} '<dependent type>'{{$}}62 63struct Test {64 void f() {65 ^{ this->yada(); }();66 // CHECK: ExprWithCleanups {{.*}} <line:[[@LINE-1]]:5, col:24> 'void'67 // CHECK-NEXT: cleanup Block68 // CHECK-NEXT: CallExpr {{.*}} <col:5, col:24> 'void'69 // CHECK-NEXT: BlockExpr {{.*}} <col:5, col:22> 'void (^)()'70 // CHECK-NEXT: BlockDecl {{.*}} <col:5, col:22> col:5 captures_this71 // CHECK-NEXT: CompoundStmt {{.*}} <col:6, col:22>72 // CHECK-NEXT: CXXMemberCallExpr {{.*}} <col:8, col:19> 'void'73 // CHECK-NEXT: MemberExpr {{.*}} <col:8, col:14> '<bound member function type>' ->yada74 // CHECK-NEXT: CXXThisExpr {{.*}} <col:8> 'Test *' this75 }76 void yada();77 // CHECK: CXXMethodDecl {{.*}} <line:[[@LINE-1]]:3, col:13> col:8 used yada 'void (){{.*}}'78};79 80@protocol P81@end;82 83using TestObjCPointerWithoutStar = id<P>;84// CHECK: TypeAliasDecl {{.+}} <{{.+}}:[[@LINE-1]]:1, col:40> col:7 TestObjCPointerWithoutStar 'id<P>'85 86using TestObjCPointerWithStar = A *;87// CHECK: TypeAliasDecl {{.+}} <{{.+}}:[[@LINE-1]]:1, col:35> col:7 TestObjCPointerWithStar 'A *'88