annotate clang/test/Index/index-decls.m @ 173:0572611fdcc8 llvm10 llvm12

reorgnization done
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 11:55:54 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 @interface I
anatofuz
parents:
diff changeset
2 @property (readonly) id prop;
anatofuz
parents:
diff changeset
3 -(id)prop;
anatofuz
parents:
diff changeset
4 @end
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 @interface I()
anatofuz
parents:
diff changeset
7 @property (assign,readwrite) id prop;
anatofuz
parents:
diff changeset
8 @end
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 @implementation I
anatofuz
parents:
diff changeset
11 @synthesize prop = _prop;
anatofuz
parents:
diff changeset
12 @end
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 // rdar://11015325
anatofuz
parents:
diff changeset
15 @interface I1
anatofuz
parents:
diff changeset
16 __attribute__((something)) @interface I2 @end
anatofuz
parents:
diff changeset
17 @end
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 @interface I3
anatofuz
parents:
diff changeset
20 @property (assign,readwrite) id auto_prop;
anatofuz
parents:
diff changeset
21 @end
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 @implementation I3
anatofuz
parents:
diff changeset
24 -(void)meth {
anatofuz
parents:
diff changeset
25 _auto_prop = 0;
anatofuz
parents:
diff changeset
26 }
anatofuz
parents:
diff changeset
27 @end
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29 int test1() {
anatofuz
parents:
diff changeset
30 extern int extvar;
anatofuz
parents:
diff changeset
31 extvar = 2;
anatofuz
parents:
diff changeset
32 extern int extfn();
anatofuz
parents:
diff changeset
33 return extfn();
anatofuz
parents:
diff changeset
34 }
anatofuz
parents:
diff changeset
35
anatofuz
parents:
diff changeset
36 @interface I4
anatofuz
parents:
diff changeset
37 @property (assign, nonatomic) id prop;
anatofuz
parents:
diff changeset
38 -(id)prop;
anatofuz
parents:
diff changeset
39 -(void)setProp:(id)p;
anatofuz
parents:
diff changeset
40 @end
anatofuz
parents:
diff changeset
41
anatofuz
parents:
diff changeset
42 @implementation I4
anatofuz
parents:
diff changeset
43 @synthesize prop = _prop;
anatofuz
parents:
diff changeset
44 -(id)prop {
anatofuz
parents:
diff changeset
45 return 0;
anatofuz
parents:
diff changeset
46 }
anatofuz
parents:
diff changeset
47 -(void)setProp:(id)p {
anatofuz
parents:
diff changeset
48 }
anatofuz
parents:
diff changeset
49 @end
anatofuz
parents:
diff changeset
50
anatofuz
parents:
diff changeset
51 // rdar://25372906
anatofuz
parents:
diff changeset
52 @class I5;
anatofuz
parents:
diff changeset
53 @interface I5
anatofuz
parents:
diff changeset
54 -(void)meth;
anatofuz
parents:
diff changeset
55 @property (class) int c;
anatofuz
parents:
diff changeset
56 @end
anatofuz
parents:
diff changeset
57
anatofuz
parents:
diff changeset
58 // RUN: c-index-test -index-file %s -target x86_64-apple-macosx10.7 > %t
anatofuz
parents:
diff changeset
59 // RUN: FileCheck %s -input-file=%t
anatofuz
parents:
diff changeset
60 // CHECK: [indexDeclaration]: kind: objc-class | name: I | {{.*}} | loc: 1:12
anatofuz
parents:
diff changeset
61 // CHECK: [indexDeclaration]: kind: objc-instance-method | name: prop | {{.*}} | loc: 3:7
anatofuz
parents:
diff changeset
62 // CHECK: [indexDeclaration]: kind: objc-property | name: prop | {{.*}} | loc: 2:25
anatofuz
parents:
diff changeset
63 // CHECK: [indexDeclaration]: kind: objc-category | name: | {{.*}} | loc: 6:12
anatofuz
parents:
diff changeset
64 // CHECK: [indexDeclaration]: kind: objc-instance-method | name: setProp: | {{.*}} | loc: 7:33
anatofuz
parents:
diff changeset
65 // CHECK: [indexDeclaration]: kind: objc-property | name: prop | {{.*}} | loc: 7:33
anatofuz
parents:
diff changeset
66
anatofuz
parents:
diff changeset
67 // CHECK: [indexDeclaration]: kind: objc-instance-method | name: prop | {{.*}} | loc: 11:13 | {{.*}} | lexical-container: [I:10:17]
anatofuz
parents:
diff changeset
68 // CHECK: [indexDeclaration]: kind: objc-instance-method | name: setProp: | {{.*}} | loc: 11:13 | {{.*}} | lexical-container: [I:10:17]
anatofuz
parents:
diff changeset
69 // CHECK: [indexDeclaration]: kind: objc-ivar | name: _prop | {{.*}} | loc: 11:20
anatofuz
parents:
diff changeset
70
anatofuz
parents:
diff changeset
71 // CHECK: [indexDeclaration]: kind: objc-ivar | name: _auto_prop | {{.*}} | loc: 20:33
anatofuz
parents:
diff changeset
72 // CHECK: [indexEntityReference]: kind: objc-ivar | name: _auto_prop | {{.*}} | loc: 25:3
anatofuz
parents:
diff changeset
73
anatofuz
parents:
diff changeset
74 // CHECK: [indexDeclaration]: kind: function | name: test1 | {{.*}} | loc: 29:5
anatofuz
parents:
diff changeset
75 // CHECK: [indexDeclaration]: kind: variable | name: extvar | {{.*}} | loc: 30:14
anatofuz
parents:
diff changeset
76 // CHECK: [indexEntityReference]: kind: variable | name: extvar | {{.*}} | loc: 31:3
anatofuz
parents:
diff changeset
77 // CHECK: [indexDeclaration]: kind: function | name: extfn | {{.*}} | loc: 32:14
anatofuz
parents:
diff changeset
78 // CHECK: [indexEntityReference]: kind: function | name: extfn | {{.*}} | loc: 33:10
anatofuz
parents:
diff changeset
79
anatofuz
parents:
diff changeset
80 // CHECK: [indexDeclaration]: kind: objc-class | name: I4 | {{.*}} | loc: 36:12
anatofuz
parents:
diff changeset
81 // CHECK: [indexEntityReference]: kind: objc-property | name: prop | {{.*}} | cursor: ObjCSynthesizeDecl=prop:37:34 (Definition) | loc: 43:13 | <parent>:: kind: objc-class | name: I4 | {{.*}} | container: [I4:42:17] | refkind: direct
anatofuz
parents:
diff changeset
82 // CHECK-NOT: [indexDeclaration]: kind: objc-instance-method {{.*}} loc: 37:
anatofuz
parents:
diff changeset
83 // CHECK-NOT: [indexDeclaration]: kind: objc-instance-method {{.*}} loc: 43:
anatofuz
parents:
diff changeset
84
anatofuz
parents:
diff changeset
85 // CHECK: [indexDeclaration]: kind: objc-instance-method | name: meth | {{.*}} loc: 54:8 | {{.*}} | isRedecl: 0 | isDef: 0 |
anatofuz
parents:
diff changeset
86 // CHECK: [indexDeclaration]: kind: objc-property | name: c | USR: c:objc(cs)I5(cpy)c | lang: ObjC | cursor: ObjCPropertyDecl=c:55:23 [class,] | loc: 55:23