Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / Index / index-decls.m
blob426c28d199546d7fa366dfb8c76a2c8b4596662e
1 @interface I
2 @property (readonly) id prop;
3  -(id)prop;
4 @end
6 @interface I()
7 @property (assign,readwrite) id prop;
8 @end
10 @implementation I
11 @synthesize prop = _prop;
12 @end
14 @interface I1
15 __attribute__((something)) @interface I2 @end
16 @end
18 @interface I3
19 @property (assign,readwrite) id auto_prop;
20 @end
22 @implementation I3
23 -(void)meth {
24   _auto_prop = 0;
26 @end
28 int test1() {
29   extern int extvar;
30   extvar = 2;
31   extern int extfn();
32   return extfn();
35 @interface I4
36 @property (assign, nonatomic) id prop;
37 -(id)prop;
38 -(void)setProp:(id)p;
39 @end
41 @implementation I4
42 @synthesize prop = _prop;
43 -(id)prop {
44   return 0;
46 -(void)setProp:(id)p {
48 @end
50 @class I5;
51 @interface I5
52 -(void)meth;
53 @property (class) int c;
54 @end
56 // RUN: c-index-test -index-file %s -target x86_64-apple-macosx10.7 > %t
57 // RUN: FileCheck %s -input-file=%t
58 // CHECK: [indexDeclaration]: kind: objc-class | name: I | {{.*}} | loc: 1:12
59 // CHECK: [indexDeclaration]: kind: objc-instance-method | name: prop | {{.*}} | loc: 3:7
60 // CHECK: [indexDeclaration]: kind: objc-property | name: prop | {{.*}} | loc: 2:25
61 // CHECK: [indexDeclaration]: kind: objc-category | name:  | {{.*}} | loc: 6:12
62 // CHECK: [indexDeclaration]: kind: objc-instance-method | name: setProp: | {{.*}} | loc: 7:33
63 // CHECK: [indexDeclaration]: kind: objc-property | name: prop | {{.*}} | loc: 7:33
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:20
69 // CHECK: [indexDeclaration]: kind: objc-ivar | name: _auto_prop | {{.*}} | loc: 19:33
70 // CHECK: [indexEntityReference]: kind: objc-ivar | name: _auto_prop | {{.*}} | loc: 24:3
72 // CHECK: [indexDeclaration]: kind: function | name: test1 | {{.*}} | loc: 28:5
73 // CHECK: [indexDeclaration]: kind: variable | name: extvar | {{.*}} | loc: 29:14
74 // CHECK: [indexEntityReference]: kind: variable | name: extvar | {{.*}} | loc: 30:3
75 // CHECK: [indexDeclaration]: kind: function | name: extfn | {{.*}} | loc: 31:14
76 // CHECK: [indexEntityReference]: kind: function | name: extfn | {{.*}} | loc: 32:10
78 // CHECK: [indexDeclaration]: kind: objc-class | name: I4 | {{.*}} | loc: 35:12
79 // 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: direct
80 // CHECK-NOT: [indexDeclaration]: kind: objc-instance-method {{.*}} loc: 36:
81 // CHECK-NOT: [indexDeclaration]: kind: objc-instance-method {{.*}} loc: 42:
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:23