blob: be42b9b855efdd1ff0066a180156a8c7284695df [file] [log] [blame]
Douglas Gregor22f56992010-04-06 19:22:33 +00001// Note: the run lines follow their respective tests, since line/column
2// matter in this test.
3
4@interface A
5+ (id)alloc;
6+ (id)init;
7+ (id)new;
8+ (Class)class;
9+ (Class)superclass;
10- (id)retain;
11- (id)autorelease;
12- (id)superclass;
13@end
14
15@interface B : A
16- (int)B_method;
17@end
18
19@interface Unrelated
20+ (id)icky;
21@end
22
23void message_id(B *b) {
24 [[A alloc] init];
25 [[b retain] B_method];
26 [[b superclass] B_method];
27}
28
Douglas Gregor265f7492010-08-27 15:29:55 +000029@implementation Unrelated
30+ (id)alloc {
31 return [A alloc];
32}
33@end
Douglas Gregor22f56992010-04-06 19:22:33 +000034// RUN: c-index-test -code-completion-at=%s:24:14 %s | FileCheck -check-prefix=CHECK-CC1 %s
35// CHECK-CC1: ObjCInstanceMethodDecl:{ResultType id}{TypedText autorelease}
36// CHECK-CC1-NOT: B_method
37// CHECK-CC1: ObjCInstanceMethodDecl:{ResultType id}{TypedText retain}
38// RUN: c-index-test -code-completion-at=%s:25:15 %s | FileCheck -check-prefix=CHECK-CC2 %s
39// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText autorelease}
40// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType int}{TypedText B_method}
41// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText retain}
42// RUN: c-index-test -code-completion-at=%s:26:19 %s | FileCheck -check-prefix=CHECK-CC3 %s
43// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType id}{TypedText autorelease}
44// CHECK-CC3-NOT: B_method
45// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType id}{TypedText retain}
46
47
Douglas Gregor265f7492010-08-27 15:29:55 +000048// RUN: c-index-test -code-completion-at=%s:31:13 %s | FileCheck -check-prefix=CHECK-SELECTOR-PREF %s
49// CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType id}{TypedText alloc} (17)
50// CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType Class}{TypedText class} (20)
51// CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType id}{TypedText init} (20)
52// CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType id}{TypedText new} (20)
53// CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType Class}{TypedText superclass} (20)
54