annotate clang/test/Index/complete-objc-message-id.m @ 173:0572611fdcc8 llvm10 llvm12

reorgnization done
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 11:55:54 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // Note: the run lines follow their respective tests, since line/column
anatofuz
parents:
diff changeset
2 // matter in this test.
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 @interface A
anatofuz
parents:
diff changeset
5 + (id)alloc;
anatofuz
parents:
diff changeset
6 + (id)init;
anatofuz
parents:
diff changeset
7 + (id)new;
anatofuz
parents:
diff changeset
8 + (Class)class;
anatofuz
parents:
diff changeset
9 + (Class)superclass;
anatofuz
parents:
diff changeset
10 - (id)retain;
anatofuz
parents:
diff changeset
11 - (id)autorelease;
anatofuz
parents:
diff changeset
12 - (id)superclass;
anatofuz
parents:
diff changeset
13 @end
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15 @interface B : A
anatofuz
parents:
diff changeset
16 - (int)B_method;
anatofuz
parents:
diff changeset
17 @end
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 @interface Unrelated
anatofuz
parents:
diff changeset
20 + (id)icky;
anatofuz
parents:
diff changeset
21 @end
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 void message_id(B *b) {
anatofuz
parents:
diff changeset
24 [[A alloc] init];
anatofuz
parents:
diff changeset
25 [[b retain] B_method];
anatofuz
parents:
diff changeset
26 [[b superclass] B_method];
anatofuz
parents:
diff changeset
27 }
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29 @implementation Unrelated
anatofuz
parents:
diff changeset
30 + (id)alloc {
anatofuz
parents:
diff changeset
31 return [A alloc];
anatofuz
parents:
diff changeset
32 }
anatofuz
parents:
diff changeset
33 @end
anatofuz
parents:
diff changeset
34
anatofuz
parents:
diff changeset
35 @protocol P1
anatofuz
parents:
diff changeset
36 - (int)P1_method1;
anatofuz
parents:
diff changeset
37 + (int)P1_method2;
anatofuz
parents:
diff changeset
38 @end
anatofuz
parents:
diff changeset
39
anatofuz
parents:
diff changeset
40 @protocol P2 <P1>
anatofuz
parents:
diff changeset
41 - (int)P2_method1;
anatofuz
parents:
diff changeset
42 + (int)P2_method2;
anatofuz
parents:
diff changeset
43 @end
anatofuz
parents:
diff changeset
44
anatofuz
parents:
diff changeset
45 void message_qualified_id(id<P2> ip2) {
anatofuz
parents:
diff changeset
46 [ip2 P1_method];
anatofuz
parents:
diff changeset
47 ip2 P1_method];
anatofuz
parents:
diff changeset
48 }
anatofuz
parents:
diff changeset
49
anatofuz
parents:
diff changeset
50 // RUN: c-index-test -code-completion-at=%s:24:14 %s | FileCheck -check-prefix=CHECK-CC1 %s
anatofuz
parents:
diff changeset
51 // CHECK-CC1: ObjCInstanceMethodDecl:{ResultType id}{TypedText autorelease}
anatofuz
parents:
diff changeset
52 // CHECK-CC1-NOT: B_method
anatofuz
parents:
diff changeset
53 // CHECK-CC1: ObjCInstanceMethodDecl:{ResultType id}{TypedText retain}
anatofuz
parents:
diff changeset
54 // RUN: c-index-test -code-completion-at=%s:25:15 %s | FileCheck -check-prefix=CHECK-CC2 %s
anatofuz
parents:
diff changeset
55 // CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText autorelease}
anatofuz
parents:
diff changeset
56 // CHECK-CC2: ObjCInstanceMethodDecl:{ResultType int}{TypedText B_method}
anatofuz
parents:
diff changeset
57 // CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText retain}
anatofuz
parents:
diff changeset
58 // RUN: c-index-test -code-completion-at=%s:26:19 %s | FileCheck -check-prefix=CHECK-CC3 %s
anatofuz
parents:
diff changeset
59 // CHECK-CC3: ObjCInstanceMethodDecl:{ResultType id}{TypedText autorelease}
anatofuz
parents:
diff changeset
60 // CHECK-CC3-NOT: B_method
anatofuz
parents:
diff changeset
61 // CHECK-CC3: ObjCInstanceMethodDecl:{ResultType id}{TypedText retain}
anatofuz
parents:
diff changeset
62
anatofuz
parents:
diff changeset
63
anatofuz
parents:
diff changeset
64 // RUN: c-index-test -code-completion-at=%s:31:13 %s | FileCheck -check-prefix=CHECK-SELECTOR-PREF %s
anatofuz
parents:
diff changeset
65 // CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType id}{TypedText alloc} (32)
anatofuz
parents:
diff changeset
66 // CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType Class}{TypedText class} (35)
anatofuz
parents:
diff changeset
67 // CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType id}{TypedText init} (35)
anatofuz
parents:
diff changeset
68 // CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType id}{TypedText new} (35)
anatofuz
parents:
diff changeset
69 // CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType Class}{TypedText superclass} (35)
anatofuz
parents:
diff changeset
70
anatofuz
parents:
diff changeset
71 // RUN: c-index-test -code-completion-at=%s:46:8 %s | FileCheck -check-prefix=CHECK-INSTANCE-QUAL-ID %s
anatofuz
parents:
diff changeset
72 // RUN: c-index-test -code-completion-at=%s:47:8 %s | FileCheck -check-prefix=CHECK-INSTANCE-QUAL-ID %s
anatofuz
parents:
diff changeset
73 // CHECK-INSTANCE-QUAL-ID: ObjCInstanceMethodDecl:{ResultType int}{TypedText P1_method1} (37)
anatofuz
parents:
diff changeset
74 // CHECK-INSTANCE-QUAL-ID: ObjCInstanceMethodDecl:{ResultType int}{TypedText P2_method1} (35)