complete-objc-message-id.m revision 22f569918dd599eb6d810e066eddc4ae74c6b2b0
1// 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
29// RUN: c-index-test -code-completion-at=%s:24:14 %s | FileCheck -check-prefix=CHECK-CC1 %s
30// CHECK-CC1: ObjCInstanceMethodDecl:{ResultType id}{TypedText autorelease}
31// CHECK-CC1-NOT: B_method
32// CHECK-CC1: ObjCInstanceMethodDecl:{ResultType id}{TypedText retain}
33// RUN: c-index-test -code-completion-at=%s:25:15 %s | FileCheck -check-prefix=CHECK-CC2 %s
34// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText autorelease}
35// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType int}{TypedText B_method}
36// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText retain}
37// RUN: c-index-test -code-completion-at=%s:26:19 %s | FileCheck -check-prefix=CHECK-CC3 %s
38// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType id}{TypedText autorelease}
39// CHECK-CC3-NOT: B_method
40// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType id}{TypedText retain}
41
42
43