brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 044c828 Raw
75 lines · plain
1// Note: the run lines follow their respective tests, since line/column2// matter in this test.3 4@interface A5+ (id)alloc;6+ (id)init;7+ (id)new;8+ (Class)class;9+ (Class)superclass;10- (id)retain;11- (id)autorelease;12- (id)superclass;13@end14 15@interface B : A16- (int)B_method;17@end18 19@interface Unrelated20+ (id)icky;21@end22 23void message_id(B *b) {24  [[A alloc] init];25  [[b retain] B_method];26  [[b superclass] B_method];27}28 29@implementation Unrelated30+ (id)alloc {31  return [A alloc];32}33@end34 35@protocol P136- (int)P1_method1;37+ (int)P1_method2;38@end39 40@protocol P2 <P1>41- (int)P2_method1;42+ (int)P2_method2;43@end44 45void message_qualified_id(id<P2> ip2) {46  [ip2 P1_method];47   ip2 P1_method];48}49 50// RUN: c-index-test -code-completion-at=%s:24:14 %s | FileCheck -check-prefix=CHECK-CC1 %s51// CHECK-CC1: ObjCInstanceMethodDecl:{ResultType id}{TypedText autorelease}52// CHECK-CC1-NOT: B_method53// CHECK-CC1: ObjCInstanceMethodDecl:{ResultType id}{TypedText retain}54// RUN: c-index-test -code-completion-at=%s:25:15 %s | FileCheck -check-prefix=CHECK-CC2 %s55// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText autorelease}56// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType int}{TypedText B_method}57// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText retain}58// RUN: c-index-test -code-completion-at=%s:26:19 %s | FileCheck -check-prefix=CHECK-CC3 %s59// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType id}{TypedText autorelease}60// CHECK-CC3-NOT: B_method61// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType id}{TypedText retain}62 63 64// RUN: c-index-test -code-completion-at=%s:31:13 %s | FileCheck -check-prefix=CHECK-SELECTOR-PREF %s65// CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType id}{TypedText alloc} (32)66// CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType Class}{TypedText class} (35)67// CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType id}{TypedText init} (35)68// CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType id}{TypedText new} (35)69// CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType Class}{TypedText superclass} (35)70 71// RUN: c-index-test -code-completion-at=%s:46:8 %s | FileCheck -check-prefix=CHECK-INSTANCE-QUAL-ID %s72// RUN: c-index-test -code-completion-at=%s:47:8 %s | FileCheck -check-prefix=CHECK-INSTANCE-QUAL-ID %s73// CHECK-INSTANCE-QUAL-ID: ObjCInstanceMethodDecl:{ResultType int}{TypedText P1_method1} (37)74// CHECK-INSTANCE-QUAL-ID: ObjCInstanceMethodDecl:{ResultType int}{TypedText P2_method1} (35)75