xref: /minix3/external/bsd/llvm/dist/clang/test/Index/index-decls.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc@interface I
2*f4a2713aSLionel Sambuc@property (readonly) id prop;
3*f4a2713aSLionel Sambuc -(id)prop;
4*f4a2713aSLionel Sambuc@end
5*f4a2713aSLionel Sambuc
6*f4a2713aSLionel Sambuc@interface I()
7*f4a2713aSLionel Sambuc@property (assign,readwrite) id prop;
8*f4a2713aSLionel Sambuc@end
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambuc@implementation I
11*f4a2713aSLionel Sambuc@synthesize prop = _prop;
12*f4a2713aSLionel Sambuc@end
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambuc// rdar://11015325
15*f4a2713aSLionel Sambuc@interface I1
16*f4a2713aSLionel Sambuc__attribute__((something)) @interface I2 @end
17*f4a2713aSLionel Sambuc@end
18*f4a2713aSLionel Sambuc
19*f4a2713aSLionel Sambuc@interface I3
20*f4a2713aSLionel Sambuc@property (assign,readwrite) id auto_prop;
21*f4a2713aSLionel Sambuc@end
22*f4a2713aSLionel Sambuc
23*f4a2713aSLionel Sambuc@implementation I3
24*f4a2713aSLionel Sambuc-(void)meth {
25*f4a2713aSLionel Sambuc  _auto_prop = 0;
26*f4a2713aSLionel Sambuc}
27*f4a2713aSLionel Sambuc@end
28*f4a2713aSLionel Sambuc
29*f4a2713aSLionel Sambucint test1() {
30*f4a2713aSLionel Sambuc  extern int extvar;
31*f4a2713aSLionel Sambuc  extvar = 2;
32*f4a2713aSLionel Sambuc  extern int extfn();
33*f4a2713aSLionel Sambuc  return extfn();
34*f4a2713aSLionel Sambuc}
35*f4a2713aSLionel Sambuc
36*f4a2713aSLionel Sambuc@interface I4
37*f4a2713aSLionel Sambuc@property (assign, nonatomic) id prop;
38*f4a2713aSLionel Sambuc-(id)prop;
39*f4a2713aSLionel Sambuc-(void)setProp:(id)p;
40*f4a2713aSLionel Sambuc@end
41*f4a2713aSLionel Sambuc
42*f4a2713aSLionel Sambuc@implementation I4
43*f4a2713aSLionel Sambuc@synthesize prop = _prop;
44*f4a2713aSLionel Sambuc-(id)prop {
45*f4a2713aSLionel Sambuc  return 0;
46*f4a2713aSLionel Sambuc}
47*f4a2713aSLionel Sambuc-(void)setProp:(id)p {
48*f4a2713aSLionel Sambuc}
49*f4a2713aSLionel Sambuc@end
50*f4a2713aSLionel Sambuc
51*f4a2713aSLionel Sambuc// RUN: c-index-test -index-file %s -target x86_64-apple-macosx10.7 > %t
52*f4a2713aSLionel Sambuc// RUN: FileCheck %s -input-file=%t
53*f4a2713aSLionel Sambuc// CHECK: [indexDeclaration]: kind: objc-class | name: I | {{.*}} | loc: 1:12
54*f4a2713aSLionel Sambuc// CHECK: [indexDeclaration]: kind: objc-instance-method | name: prop | {{.*}} | loc: 3:2
55*f4a2713aSLionel Sambuc// CHECK: [indexDeclaration]: kind: objc-property | name: prop | {{.*}} | loc: 2:25
56*f4a2713aSLionel Sambuc// CHECK: [indexDeclaration]: kind: objc-category | name:  | {{.*}} | loc: 6:12
57*f4a2713aSLionel Sambuc// CHECK: [indexDeclaration]: kind: objc-instance-method | name: setProp: | {{.*}} | loc: 7:33
58*f4a2713aSLionel Sambuc// CHECK: [indexDeclaration]: kind: objc-property | name: prop | {{.*}} | loc: 7:33
59*f4a2713aSLionel Sambuc
60*f4a2713aSLionel Sambuc// CHECK: [indexDeclaration]: kind: objc-ivar | name: _prop | {{.*}} | loc: 11:20
61*f4a2713aSLionel Sambuc// CHECK: [indexDeclaration]: kind: objc-instance-method | name: prop | {{.*}} | loc: 11:13 | {{.*}} | lexical-container: [I:10:17]
62*f4a2713aSLionel Sambuc// CHECK: [indexDeclaration]: kind: objc-instance-method | name: setProp: | {{.*}} | loc: 11:13 | {{.*}} | lexical-container: [I:10:17]
63*f4a2713aSLionel Sambuc
64*f4a2713aSLionel Sambuc// CHECK: [indexDeclaration]: kind: objc-ivar | name: _auto_prop | {{.*}} | loc: 20:33
65*f4a2713aSLionel Sambuc// CHECK: [indexEntityReference]: kind: objc-ivar | name: _auto_prop | {{.*}} | loc: 25:3
66*f4a2713aSLionel Sambuc
67*f4a2713aSLionel Sambuc// CHECK: [indexDeclaration]: kind: function | name: test1 | {{.*}} | loc: 29:5
68*f4a2713aSLionel Sambuc// CHECK: [indexDeclaration]: kind: variable | name: extvar | {{.*}} | loc: 30:14
69*f4a2713aSLionel Sambuc// CHECK: [indexEntityReference]: kind: variable | name: extvar | {{.*}} | loc: 31:3
70*f4a2713aSLionel Sambuc// CHECK: [indexDeclaration]: kind: function | name: extfn | {{.*}} | loc: 32:14
71*f4a2713aSLionel Sambuc// CHECK: [indexEntityReference]: kind: function | name: extfn | {{.*}} | loc: 33:10
72*f4a2713aSLionel Sambuc
73*f4a2713aSLionel Sambuc// CHECK: [indexDeclaration]: kind: objc-class | name: I4 | {{.*}} | loc: 36:12
74*f4a2713aSLionel Sambuc// CHECK-NOT: [indexDeclaration]: kind: objc-instance-method {{.*}} loc: 37:
75*f4a2713aSLionel Sambuc// CHECK-NOT: [indexDeclaration]: kind: objc-instance-method {{.*}} loc: 43:
76