brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.7 KiB · 7dd4f1c Raw
178 lines · plain
1/* Note: the RUN lines are near the end of the file, since line/column2 matter for this test. */3@class MyClass;4@interface I1 5{6  id StoredProp3;7  int RandomIVar;8}9@property int Prop0;10@property int Prop1;11@property float Prop2;12@end13 14@interface I2 : I115@property id Prop3;16@property id Prop4;17@end18 19@implementation I220@synthesize Prop2, Prop1, Prop3 = StoredProp3;21@dynamic Prop4;22@end23 24@interface I3 : I225@property id Prop3;26@end27 28id test(I3 *i3) {29  return i3.Prop3;30}31 32@interface I433@property id Prop2;34@end35 36@interface I4 () {37  I4 *Prop1;38}39@end40 41@implementation I4 {42  id Prop2_;43}44 45@synthesize Prop2 = Prop2_;46@end47 48@protocol P149@property int Prop5;50@end51 52@class P1;53 54@interface I5<P1>55@end56@implementation I557@synthesize Prop5;58@end59// RUN: c-index-test -code-completion-at=%s:20:13 %s | FileCheck -check-prefix=CHECK-CC1 %s60// 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}65// RUN: c-index-test -code-completion-at=%s:20:20 %s | FileCheck -check-prefix=CHECK-CC2 %s66// 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}70// RUN: c-index-test -code-completion-at=%s:20:35 %s | FileCheck -check-prefix=CHECK-CC3 %s71// CHECK-CC3: ObjCIvarDecl:{ResultType id}{TypedText _Prop3} (36)72// CHECK-CC3: ObjCIvarDecl:{ResultType int}{TypedText RandomIVar} (35)73// CHECK-CC3: ObjCIvarDecl:{ResultType id}{TypedText StoredProp3} (8)74 75// RUN: c-index-test -code-completion-at=%s:21:10 %s | FileCheck -check-prefix=CHECK-CC4 %s76// CHECK-CC4: ObjCPropertyDecl:{ResultType int}{TypedText Prop0}77// CHECK-CC4-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop4}78 79// RUN: c-index-test -code-completion-at=%s:29:13 %s | FileCheck -check-prefix=CHECK-CC5 %s80// CHECK-CC5: ObjCPropertyDecl:{ResultType int}{TypedText Prop0} (37)81// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText Prop1} (37)82// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType float}{TypedText Prop2} (37)83// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop3} (35)84// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop4} (37)85 86// RUN: c-index-test -code-completion-at=%s:9:11 %s | FileCheck -check-prefix=CHECK-CC6 %s87// CHECK-CC6: ObjCInterfaceDecl:{TypedText MyClass} (50)88 89 90// RUN: c-index-test -code-completion-at=%s:45:21 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC7 %s91// 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)94 95// RUN: c-index-test -code-completion-at=%s:57:13 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC8 %s96// CHECK-CC8: ObjCPropertyDecl:{ResultType int}{TypedText Prop5} (37)97 98@interface ClassProperties99 100@property int instanceProperty;101@property(class) int explicit;102@property(class, readonly) int explicitReadonly;103 104+ (int)implicit;105+ (int)setImplicit:(int)x;106 107+ (int)implicitReadonly;108 109+ (void)noProperty;110 111- (int)implicitInstance;112 113+ (int)shadowedImplicit;114 115@end116 117@interface ClassProperties (Category)118 119+ (int)implicitInCategory;120 121@end122 123@protocol ProtocolClassProperties124 125@property(class, readonly) int explicitInProtocol;126 127@end128 129@interface SubClassProperties: ClassProperties <ProtocolClassProperties>130 131@property(class) ClassProperties *shadowedImplicit;132 133@end134 135@implementation SubClassProperties136 137-(void) foo {138  super.instanceProperty;139}140 141@end142 143void classProperties() {144  (void)ClassProperties.implicit;145  (void)SubClassProperties.explicit;146}147 148// RUN: c-index-test -code-completion-at=%s:144:25 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC9 %s149// CHECK-CC9: ObjCPropertyDecl:{ResultType int}{TypedText explicit} (35)150// CHECK-CC9-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText explicitReadonly} (35)151// CHECK-CC9-NEXT: ObjCClassMethodDecl:{ResultType int}{TypedText implicit} (37)152// CHECK-CC9-NEXT: ObjCClassMethodDecl:{ResultType int}{TypedText implicitInCategory} (37)153// CHECK-CC9-NEXT: ObjCClassMethodDecl:{ResultType int}{TypedText implicitReadonly} (37)154// CHECK-CC9-NEXT: ObjCClassMethodDecl:{ResultType int}{TypedText shadowedImplicit} (37)155// CHECK-CC9-NOT: implicitInstance156// CHECK-CC9-NOT: noProperty157// CHECK-CC9-NOT: instanceProperty158 159// RUN: c-index-test -code-completion-at=%s:145:28 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC10 %s160// CHECK-CC10: ObjCPropertyDecl:{ResultType int}{TypedText explicit} (37)161// CHECK-CC10-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText explicitInProtocol} (37)162// CHECK-CC10-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText explicitReadonly} (37)163// CHECK-CC10-NEXT: ObjCClassMethodDecl:{ResultType int}{TypedText implicit} (39)164// CHECK-CC10-NEXT: ObjCClassMethodDecl:{ResultType int}{TypedText implicitInCategory} (39)165// CHECK-CC10-NEXT: ObjCClassMethodDecl:{ResultType int}{TypedText implicitReadonly} (39)166// CHECK-CC10-NEXT: ObjCPropertyDecl:{ResultType ClassProperties *}{TypedText shadowedImplicit} (35)167// CHECK-CC10-NOT: implicitInstance168// CHECK-CC10-NOT: noProperty169// CHECK-CC10-NOT: instanceProperty170 171// RUN: c-index-test -code-completion-at=%s:138:9 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC11 %s172// CHECK-CC11-NOT: explicit173// CHECK-CC11-NOT: explicitReadonly174// CHECK-CC11-NOT: implicit175// CHECK-CC11-NOT: implicitReadonly176// CHECK-CC11-NOT: shadowedImplicit177// CHECK-CC11-NOT: implicitInCategory178