85 lines · plain
1@interface I2@property (readonly) id prop;3 -(id)prop;4@end5 6@interface I()7@property (assign,readwrite) id prop;8@end9 10@implementation I11@synthesize prop = _prop;12@end13 14@interface I115__attribute__((something)) @interface I2 @end16@end17 18@interface I319@property (assign,readwrite) id auto_prop;20@end21 22@implementation I323-(void)meth {24 _auto_prop = 0;25}26@end27 28int test1() {29 extern int extvar;30 extvar = 2;31 extern int extfn();32 return extfn();33}34 35@interface I436@property (assign, nonatomic) id prop;37-(id)prop;38-(void)setProp:(id)p;39@end40 41@implementation I442@synthesize prop = _prop;43-(id)prop {44 return 0;45}46-(void)setProp:(id)p {47}48@end49 50@class I5;51@interface I552-(void)meth;53@property (class) int c;54@end55 56// RUN: c-index-test -index-file %s -target x86_64-apple-macosx10.7 > %t57// RUN: FileCheck %s -input-file=%t58// CHECK: [indexDeclaration]: kind: objc-class | name: I | {{.*}} | loc: 1:1259// CHECK: [indexDeclaration]: kind: objc-instance-method | name: prop | {{.*}} | loc: 3:760// CHECK: [indexDeclaration]: kind: objc-property | name: prop | {{.*}} | loc: 2:2561// CHECK: [indexDeclaration]: kind: objc-category | name: | {{.*}} | loc: 6:1262// CHECK: [indexDeclaration]: kind: objc-instance-method | name: setProp: | {{.*}} | loc: 7:3363// CHECK: [indexDeclaration]: kind: objc-property | name: prop | {{.*}} | loc: 7:3364 65// CHECK: [indexDeclaration]: kind: objc-instance-method | name: prop | {{.*}} | loc: 11:13 | {{.*}} | lexical-container: [I:10:17]66// CHECK: [indexDeclaration]: kind: objc-instance-method | name: setProp: | {{.*}} | loc: 11:13 | {{.*}} | lexical-container: [I:10:17]67// CHECK: [indexDeclaration]: kind: objc-ivar | name: _prop | {{.*}} | loc: 11:2068 69// CHECK: [indexDeclaration]: kind: objc-ivar | name: _auto_prop | {{.*}} | loc: 19:3370// CHECK: [indexEntityReference]: kind: objc-ivar | name: _auto_prop | {{.*}} | loc: 24:371 72// CHECK: [indexDeclaration]: kind: function | name: test1 | {{.*}} | loc: 28:573// CHECK: [indexDeclaration]: kind: variable | name: extvar | {{.*}} | loc: 29:1474// CHECK: [indexEntityReference]: kind: variable | name: extvar | {{.*}} | loc: 30:375// CHECK: [indexDeclaration]: kind: function | name: extfn | {{.*}} | loc: 31:1476// CHECK: [indexEntityReference]: kind: function | name: extfn | {{.*}} | loc: 32:1077 78// CHECK: [indexDeclaration]: kind: objc-class | name: I4 | {{.*}} | loc: 35:1279// CHECK: [indexEntityReference]: kind: objc-property | name: prop | {{.*}} | cursor: ObjCSynthesizeDecl=prop:36:34 (Definition) | loc: 42:13 | <parent>:: kind: objc-class | name: I4 | {{.*}} | container: [I4:41:17] | refkind: direct80// CHECK-NOT: [indexDeclaration]: kind: objc-instance-method {{.*}} loc: 36:81// CHECK-NOT: [indexDeclaration]: kind: objc-instance-method {{.*}} loc: 42:82 83// CHECK: [indexDeclaration]: kind: objc-instance-method | name: meth | {{.*}} loc: 52:8 | {{.*}} | isRedecl: 0 | isDef: 0 |84// CHECK: [indexDeclaration]: kind: objc-property | name: c | USR: c:objc(cs)I5(cpy)c | lang: ObjC | cursor: ObjCPropertyDecl=c:53:23 [class,] | loc: 53:2385