// RUN: %clang_cc1 -Wno-unused -fblocks -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s @protocol P @end @interface A @end @interface TestObjCIvarDecl : A @end @implementation TestObjCIvarDecl { int varDefault; @private int varPrivate; @protected int varProtected; @public int varPublic; @package int varPackage; } @end // 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 @interface testObjCMethodDecl : A { } - (int) TestObjCMethodDecl: (int)i, ...; // CHECK: ObjCMethodDecl{{.*}} - TestObjCMethodDecl: 'int' variadic // CHECK-NEXT: ParmVarDecl{{.*}} i 'int' @end @implementation testObjCMethodDecl - (int) TestObjCMethodDecl: (int)i, ... { return 0; } // CHECK: ObjCMethodDecl{{.*}} - TestObjCMethodDecl: 'int' variadic // CHECK-NEXT: ImplicitParamDecl{{.*}} self // CHECK-NEXT: ImplicitParamDecl{{.*}} _cmd // CHECK-NEXT: ParmVarDecl{{.*}} i 'int' // CHECK-NEXT: CompoundStmt @end @protocol TestObjCProtocolDecl - (void) foo; @end // CHECK: ObjCProtocolDecl{{.*}} TestObjCProtocolDecl // CHECK-NEXT: ObjCMethodDecl{{.*}} foo @interface TestObjCClass : A
- (void) foo; @end // CHECK: ObjCInterfaceDecl{{.*}} TestObjCClass // CHECK-NEXT: super ObjCInterface{{.*}} 'A' // CHECK-NEXT: ObjCImplementation{{.*}} 'TestObjCClass' // CHECK-NEXT: ObjCProtocol{{.*}} 'P' // CHECK-NEXT: ObjCMethodDecl{{.*}} foo @implementation TestObjCClass : A { int i; } - (void) foo { } @end // CHECK: ObjCImplementationDecl{{.*}} TestObjCClass // CHECK-NEXT: super ObjCInterface{{.*}} 'A' // CHECK-NEXT: ObjCInterface{{.*}} 'TestObjCClass' // CHECK-NEXT: ObjCIvarDecl{{.*}} i // CHECK-NEXT: ObjCMethodDecl{{.*}} foo @interface TestObjCClass (TestObjCCategoryDecl)
- (void) bar;
@end
// CHECK: ObjCCategoryDecl{{.*}} TestObjCCategoryDecl
// CHECK-NEXT: ObjCInterface{{.*}} 'TestObjCClass'
// CHECK-NEXT: ObjCCategoryImpl{{.*}} 'TestObjCCategoryDecl'
// CHECK-NEXT: ObjCProtocol{{.*}} 'P'
// CHECK-NEXT: ObjCMethodDecl{{.*}} bar
@interface TestGenericInterface {
}
@end
// CHECK: ObjCInterfaceDecl{{.*}} TestGenericInterface
// CHECK-NEXT: -super ObjCInterface {{.+}} 'A'
// CHECK-NEXT: -ObjCProtocol {{.+}} 'P'
// CHECK-NEXT: -ObjCTypeParamDecl {{.+}}