blob: a4450563698eb362d3fa3d3356b17cc06f1986c7 [file] [log] [blame]
Douglas Gregor322328b2009-11-18 22:32:06 +00001/* Note: the RUN lines are near the end of the file, since line/column
2 matter for this test. */
Douglas Gregord98abd82011-02-16 01:39:26 +00003@class MyClass;
Douglas Gregor322328b2009-11-18 22:32:06 +00004@interface I1
5{
6 id StoredProp3;
7 int RandomIVar;
8}
Douglas Gregor424b2a52009-11-18 22:56:13 +00009@property int Prop0;
Douglas Gregor322328b2009-11-18 22:32:06 +000010@property int Prop1;
11@property float Prop2;
12@end
13
14@interface I2 : I1
15@property id Prop3;
Douglas Gregor424b2a52009-11-18 22:56:13 +000016@property id Prop4;
Douglas Gregor322328b2009-11-18 22:32:06 +000017@end
18
19@implementation I2
20@synthesize Prop2, Prop1, Prop3 = StoredProp3;
Douglas Gregor424b2a52009-11-18 22:56:13 +000021@dynamic Prop4;
Douglas Gregor322328b2009-11-18 22:32:06 +000022@end
23
Douglas Gregor73449212010-12-09 23:01:55 +000024@interface I3 : I2
25@property id Prop3;
26@end
27
28id test(I3 *i3) {
29 return i3.Prop3;
30}
31
Douglas Gregore8426052011-04-18 14:40:46 +000032@interface I4
33@property id Prop2;
34@end
35
36@interface I4 () {
37 I4 *Prop1;
38}
39@end
40
41@implementation I4 {
42 id Prop2_;
43}
44
45@synthesize Prop2 = Prop2_;
46@end
47
Douglas Gregorb92a4082012-06-12 13:44:08 +000048@protocol P1
49@property int Prop5;
50@end
51
52@class P1;
53
54@interface I5<P1>
55@end
56@implementation I5
57@synthesize Prop5;
58@end
Douglas Gregor424b2a52009-11-18 22:56:13 +000059// RUN: c-index-test -code-completion-at=%s:20:13 %s | FileCheck -check-prefix=CHECK-CC1 %s
Douglas Gregorff5ce6e2009-12-18 18:53:37 +000060// CHECK-CC1: ObjCPropertyDecl:{ResultType int}{TypedText Prop0}
61// CHECK-CC1: ObjCPropertyDecl:{ResultType int}{TypedText Prop1}
62// CHECK-CC1: ObjCPropertyDecl:{ResultType float}{TypedText Prop2}
63// CHECK-CC1: ObjCPropertyDecl:{ResultType id}{TypedText Prop3}
64// CHECK-CC1: ObjCPropertyDecl:{ResultType id}{TypedText Prop4}
Douglas Gregor424b2a52009-11-18 22:56:13 +000065// RUN: c-index-test -code-completion-at=%s:20:20 %s | FileCheck -check-prefix=CHECK-CC2 %s
Douglas Gregorff5ce6e2009-12-18 18:53:37 +000066// CHECK-CC2: ObjCPropertyDecl:{ResultType int}{TypedText Prop0}
67// CHECK-CC2: ObjCPropertyDecl:{ResultType int}{TypedText Prop1}
68// CHECK-CC2-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop3}
69// CHECK-CC2: ObjCPropertyDecl:{ResultType id}{TypedText Prop4}
Douglas Gregor424b2a52009-11-18 22:56:13 +000070// RUN: c-index-test -code-completion-at=%s:20:35 %s | FileCheck -check-prefix=CHECK-CC3 %s
Douglas Gregore8426052011-04-18 14:40:46 +000071// CHECK-CC3: ObjCIvarDecl:{ResultType id}{TypedText _Prop3} (36)
Douglas Gregoraa490cb2011-04-18 14:13:53 +000072// CHECK-CC3: ObjCIvarDecl:{ResultType int}{TypedText RandomIVar} (35)
Douglas Gregore8426052011-04-18 14:40:46 +000073// CHECK-CC3: ObjCIvarDecl:{ResultType id}{TypedText StoredProp3} (8)
Douglas Gregoraa490cb2011-04-18 14:13:53 +000074
Douglas Gregor424b2a52009-11-18 22:56:13 +000075// RUN: c-index-test -code-completion-at=%s:21:10 %s | FileCheck -check-prefix=CHECK-CC4 %s
Douglas Gregorff5ce6e2009-12-18 18:53:37 +000076// CHECK-CC4: ObjCPropertyDecl:{ResultType int}{TypedText Prop0}
77// CHECK-CC4-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop4}
Douglas Gregor73449212010-12-09 23:01:55 +000078
79// RUN: c-index-test -code-completion-at=%s:29:13 %s | FileCheck -check-prefix=CHECK-CC5 %s
80// CHECK-CC5: ObjCPropertyDecl:{ResultType int}{TypedText Prop0} (35)
81// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText Prop1} (35)
82// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType float}{TypedText Prop2} (35)
83// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop3} (35)
84// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop4} (35)
85
Douglas Gregord98abd82011-02-16 01:39:26 +000086// RUN: c-index-test -code-completion-at=%s:9:11 %s | FileCheck -check-prefix=CHECK-CC6 %s
87// CHECK-CC6: ObjCInterfaceDecl:{TypedText MyClass} (50)
88
Douglas Gregore8426052011-04-18 14:40:46 +000089
90// RUN: c-index-test -code-completion-at=%s:45:21 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC7 %s
91// CHECK-CC7-NOT: ObjCIvarDecl:{ResultType id}{TypedText _Prop2}
92// CHECK-CC7: ObjCIvarDecl:{ResultType I4 *}{TypedText Prop1} (17)
93// CHECK-CC7: ObjCIvarDecl:{ResultType id}{TypedText Prop2_} (7)
Douglas Gregorb92a4082012-06-12 13:44:08 +000094
95// RUN: c-index-test -code-completion-at=%s:57:13 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC8 %s
96// CHECK-CC8: ObjCPropertyDecl:{ResultType int}{TypedText Prop5} (35)