blob: 725f180f7c29f06957b05a84858c3e01078afd84 [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 Gregor424b2a52009-11-18 22:56:13 +000032// RUN: c-index-test -code-completion-at=%s:20:13 %s | FileCheck -check-prefix=CHECK-CC1 %s
Douglas Gregorff5ce6e2009-12-18 18:53:37 +000033// CHECK-CC1: ObjCPropertyDecl:{ResultType int}{TypedText Prop0}
34// CHECK-CC1: ObjCPropertyDecl:{ResultType int}{TypedText Prop1}
35// CHECK-CC1: ObjCPropertyDecl:{ResultType float}{TypedText Prop2}
36// CHECK-CC1: ObjCPropertyDecl:{ResultType id}{TypedText Prop3}
37// CHECK-CC1: ObjCPropertyDecl:{ResultType id}{TypedText Prop4}
Douglas Gregor424b2a52009-11-18 22:56:13 +000038// RUN: c-index-test -code-completion-at=%s:20:20 %s | FileCheck -check-prefix=CHECK-CC2 %s
Douglas Gregorff5ce6e2009-12-18 18:53:37 +000039// CHECK-CC2: ObjCPropertyDecl:{ResultType int}{TypedText Prop0}
40// CHECK-CC2: ObjCPropertyDecl:{ResultType int}{TypedText Prop1}
41// CHECK-CC2-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop3}
42// CHECK-CC2: ObjCPropertyDecl:{ResultType id}{TypedText Prop4}
Douglas Gregor424b2a52009-11-18 22:56:13 +000043// RUN: c-index-test -code-completion-at=%s:20:35 %s | FileCheck -check-prefix=CHECK-CC3 %s
Douglas Gregorff5ce6e2009-12-18 18:53:37 +000044// CHECK-CC3: ObjCIvarDecl:{ResultType int}{TypedText RandomIVar}
45// CHECK-CC3: ObjCIvarDecl:{ResultType id}{TypedText StoredProp3}
Douglas Gregor424b2a52009-11-18 22:56:13 +000046// RUN: c-index-test -code-completion-at=%s:21:10 %s | FileCheck -check-prefix=CHECK-CC4 %s
Douglas Gregorff5ce6e2009-12-18 18:53:37 +000047// CHECK-CC4: ObjCPropertyDecl:{ResultType int}{TypedText Prop0}
48// CHECK-CC4-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop4}
Douglas Gregor73449212010-12-09 23:01:55 +000049
50// RUN: c-index-test -code-completion-at=%s:29:13 %s | FileCheck -check-prefix=CHECK-CC5 %s
51// CHECK-CC5: ObjCPropertyDecl:{ResultType int}{TypedText Prop0} (35)
52// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText Prop1} (35)
53// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType float}{TypedText Prop2} (35)
54// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop3} (35)
55// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop4} (35)
56
Douglas Gregord98abd82011-02-16 01:39:26 +000057// RUN: c-index-test -code-completion-at=%s:9:11 %s | FileCheck -check-prefix=CHECK-CC6 %s
58// CHECK-CC6: ObjCInterfaceDecl:{TypedText MyClass} (50)
59