// Test without serialization:
// RUN: %clang_cc1 -Wno-unused -fblocks -ast-dump -ast-dump-filter Test %s \
// RUN: | FileCheck --strict-whitespace %s
//
// Test with serialization:
// RUN: %clang_cc1 -Wno-unused -fblocks -emit-pch -o %t %s
// RUN: %clang_cc1 -x objective-c -Wno-unused -fblocks -include-pch %t \
// RUN: -ast-dump-all -ast-dump-filter Test /dev/null \
// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
// RUN: | FileCheck --strict-whitespace %s
// CHECK: ObjCImplementationDecl{{.*}} TestObjCIvarDecl
// CHECK-NEXT: ObjCInterface{{.*}} 'TestObjCIvarDecl'
// CHECK-NEXT: ObjCIvarDecl{{.*}} varDefault 'int' private
// CHECK-NEXT: ObjCIvarDecl{{.*}} varPrivate 'int' private
// CHECK-NEXT: ObjCIvarDecl{{.*}} varProtected 'int' protected
// CHECK-NEXT: ObjCIvarDecl{{.*}} varPublic 'int' public
// CHECK-NEXT: ObjCIvarDecl{{.*}} varPackage 'int' package
// CHECK: ObjCProtocolDecl{{.*}} TestObjCProtocolDecl
// CHECK-NEXT: ObjCMethodDecl{{.*}} foo
// CHECK: ObjCInterfaceDecl{{.*}} TestObjCClass
// CHECK-NEXT: super ObjCInterface{{.*}} 'A'
// CHECK-NEXT: ObjCImplementation{{.*}} 'TestObjCClass'
// CHECK-NEXT: ObjCProtocol{{.*}} 'P'
// CHECK-NEXT: ObjCMethodDecl{{.*}} foo
// CHECK: ObjCImplementationDecl{{.*}} TestObjCClass
// CHECK-NEXT: super ObjCInterface{{.*}} 'A'
// CHECK-NEXT: ObjCInterface{{.*}} 'TestObjCClass'
// CHECK-NEXT: ObjCIvarDecl{{.*}} i
// CHECK-NEXT: ObjCMethodDecl{{.*}} foo
// CHECK: ObjCCategoryDecl{{.*}} TestObjCCategoryDecl
// CHECK-NEXT: ObjCInterface{{.*}} 'TestObjCClass'
// CHECK-NEXT: ObjCCategoryImpl{{.*}} 'TestObjCCategoryDecl'
// CHECK-NEXT: ObjCProtocol{{.*}} 'P'
// CHECK-NEXT: ObjCMethodDecl{{.*}} bar
// CHECK: ObjCInterfaceDecl{{.*}} TestGenericInterface
// CHECK-NEXT: -super ObjCInterface {{.+}} 'A'
// CHECK-NEXT: -ObjCProtocol {{.+}} 'P'
// CHECK-NEXT: -ObjCTypeParamDecl {{.+}} <col:33> col:33 T 'id':'id'
// CHECK: ObjCCategoryImplDecl{{.*}} TestObjCCategoryDecl
// CHECK-NEXT: ObjCInterface{{.*}} 'TestObjCClass'
// CHECK-NEXT: ObjCCategory{{.*}} 'TestObjCCategoryDecl'
// CHECK-NEXT: ObjCMethodDecl{{.*}} bar
@compatibility_alias TestObjCCompatibleAliasDecl A;
// CHECK: ObjCCompatibleAliasDecl{{.*}} TestObjCCompatibleAliasDecl
// CHECK-NEXT: ObjCInterface{{.*}} 'A'
// CHECK: ObjCInterfaceDecl{{.*}} TestObjCProperty
// CHECK: ObjCPropertyDecl{{.*}} foo 'int' assign readwrite atomic unsafe_unretained
// CHECK-NEXT: getter ObjCMethod{{.*}} 'getterFoo'
// CHECK-NEXT: setter ObjCMethod{{.*}} 'setterFoo:'
// CHECK-NEXT: ObjCPropertyDecl{{.*}} bar 'int' assign readwrite atomic unsafe_unretained
// CHECK-NEXT: ObjCMethodDecl{{.*}} getterFoo
// CHECK-NEXT: ObjCMethodDecl{{.*}} setterFoo:
// CHECK-NEXT: ParmVarDecl{{.*}} foo
// CHECK-NEXT: ObjCMethodDecl{{.*}} bar
// CHECK-NEXT: ObjCMethodDecl{{.*}} setBar:
// CHECK-NEXT: ParmVarDecl{{.*}} bar
// CHECK: ObjCImplementationDecl{{.*}} TestObjCProperty
// CHECK: ObjCPropertyImplDecl{{.*}} foo synthesize
// CHECK-NEXT: ObjCProperty{{.*}} 'foo'
// CHECK-NEXT: ObjCIvar{{.*}} 'i' 'int'
// CHECK-NEXT: ObjCIvarDecl{{.*}} bar 'int' synthesize private
// CHECK-NEXT: ObjCPropertyImplDecl{{.*}} bar synthesize
// CHECK-NEXT: ObjCProperty{{.*}} 'bar'
// CHECK-NEXT: ObjCIvar{{.*}} 'bar' 'int'
void
// CHECK: FunctionDecl{{.*}}TestBlockDecl
// CHECK: BlockDecl {{.+}} <col:3, col:21> col:3 variadic
// CHECK-NEXT: ParmVarDecl{{.*}} y 'int'
// CHECK-NEXT: capture ParmVar{{.*}} 'x' 'int'
// CHECK-NEXT: CompoundStmt
void
// CHECK: VarDecl{{.*}}Test 'typeof (B.foo)':'int'