xref: /aosp_15_r20/external/clang/test/Index/complete-method-decls.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li/* Note: the RUN lines are near the end of the file, since line/column
2*67e74705SXin Li   matter for this test. */
3*67e74705SXin Li#define IBAction void
4*67e74705SXin Li@protocol P1
5*67e74705SXin Li- (id)abc;
6*67e74705SXin Li- (id)initWithInt:(int)x;
7*67e74705SXin Li- (id)initWithTwoInts:(inout int)x second:(int)y;
8*67e74705SXin Li- (int)getInt;
9*67e74705SXin Li- (id)getSelf;
10*67e74705SXin Li@end
11*67e74705SXin Li@protocol P1;
12*67e74705SXin Li@protocol P2<P1>
13*67e74705SXin Li+ (id)alloc;
14*67e74705SXin Li@end
15*67e74705SXin Li
16*67e74705SXin Li@interface A <P1>
17*67e74705SXin Li- (id)init;
18*67e74705SXin Li- (int)getValue;
19*67e74705SXin Li@end
20*67e74705SXin Li
21*67e74705SXin Li@interface B : A<P2>
22*67e74705SXin Li- (id)initWithInt:(int)x;
23*67e74705SXin Li- (int)getSecondValue;
24*67e74705SXin Li- (id)getSelf;
25*67e74705SXin Li- (int)setValue:(int)x;
26*67e74705SXin Li@end
27*67e74705SXin Li
28*67e74705SXin Li@interface B (FooBar)
29*67e74705SXin Li- (id)categoryFunction:(int)x;
30*67e74705SXin Li@end
31*67e74705SXin Li
32*67e74705SXin Li@implementation B
33*67e74705SXin Li- (int)getSecondValue { return 0; }
34*67e74705SXin Li- (id)init { return self; }
35*67e74705SXin Li- (id)getSelf { return self; }
36*67e74705SXin Li- (void)setValue:(int)x { }
37*67e74705SXin Li- (id)initWithTwoInts:(int)x second:(int)y { return self; }
38*67e74705SXin Li+ (id)alloc { return 0; }
39*67e74705SXin Li@end
40*67e74705SXin Li
41*67e74705SXin Li@implementation B (FooBar)
42*67e74705SXin Li- (id)categoryFunction:(int)x { return self; }
43*67e74705SXin Li@end
44*67e74705SXin Li
45*67e74705SXin Li@interface C
46*67e74705SXin Li- (int)first:(int)x second:(float)y third:(double)z;
47*67e74705SXin Li- (id)first:(int)xx second2:(float)y2 third:(double)z;
48*67e74705SXin Li- (void*)first:(int)xxx second3:(float)y3 third:(double)z;
49*67e74705SXin Li@end
50*67e74705SXin Li
51*67e74705SXin Li@interface D
52*67e74705SXin Li- (int)first:(int)x second2:(float)y third:(double)z;
53*67e74705SXin Li@end
54*67e74705SXin Li
55*67e74705SXin Li@implementation D
56*67e74705SXin Li- (int)first:(int)x second2:(float)y third:(double)z { }
57*67e74705SXin Li@end
58*67e74705SXin Li
59*67e74705SXin Li@interface Passing
60*67e74705SXin Li- (oneway void)method:(in id)x;
61*67e74705SXin Li@end
62*67e74705SXin Li
63*67e74705SXin Li@interface Gaps
64*67e74705SXin Li- (void)method:(int)x :(int)y;
65*67e74705SXin Li@end
66*67e74705SXin Li
67*67e74705SXin Li@implementation Gaps
68*67e74705SXin Li- (void)method:(int)x :(int)y {}
69*67e74705SXin Li@end
70*67e74705SXin Li
71*67e74705SXin Li@implementation Passing
72*67e74705SXin Li- (oneway void)method:(in id x) {}
73*67e74705SXin Li@end
74*67e74705SXin Li
75*67e74705SXin Litypedef A MyObject;
76*67e74705SXin Litypedef A *MyObjectRef;
77*67e74705SXin Li
78*67e74705SXin Li@interface I1
79*67e74705SXin Li-(Class<P1>)meth;
80*67e74705SXin Li-(MyObject <P1> *)meth2;
81*67e74705SXin Li-(MyObjectRef)meth3;
82*67e74705SXin Li@end
83*67e74705SXin Li
84*67e74705SXin Li@implementation I1
85*67e74705SXin Li-(void)foo {}
86*67e74705SXin Li@end
87*67e74705SXin Li
88*67e74705SXin Li@interface I2
89*67e74705SXin Li-(nonnull I2 *)produceI2:(nullable I2 *)i2;
90*67e74705SXin Li-(int *__nullable *__nullable)something:(void(^__nullable)(int *__nullable))b;
91*67e74705SXin Li@property (nullable, strong) id prop;
92*67e74705SXin Li@property (nullable, strong) void(^propWB)(int *_Nullable);
93*67e74705SXin Li@end
94*67e74705SXin Li
95*67e74705SXin Li@implementation I2
96*67e74705SXin Li-(void)foo {}
97*67e74705SXin Li@end
98*67e74705SXin Li
99*67e74705SXin Li#pragma clang assume_nonnull begin
100*67e74705SXin Li@interface I3
101*67e74705SXin Li-(I3 *)produceI3:(I3 *)i3;
102*67e74705SXin Li-(instancetype)getI3;
103*67e74705SXin Li@end
104*67e74705SXin Li#pragma clang assume_nonnull end
105*67e74705SXin Li
106*67e74705SXin Li@implementation I3
107*67e74705SXin Li-(void)foo {}
108*67e74705SXin Li@end
109*67e74705SXin Li
110*67e74705SXin Li// RUN: c-index-test -code-completion-at=%s:17:3 %s | FileCheck -check-prefix=CHECK-CC1 %s
111*67e74705SXin Li// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText abc} (40)
112*67e74705SXin Li// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text int}{RightParen )}{TypedText getInt} (40)
113*67e74705SXin Li// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText getSelf} (40)
114*67e74705SXin Li// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText initWithInt}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x} (40)
115*67e74705SXin Li// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText initWithTwoInts}{TypedText :}{LeftParen (}{Text inout }{Text int}{RightParen )}{Text x}{HorizontalSpace  }{TypedText second:}{LeftParen (}{Text int}{RightParen )}{Text y} (40)
116*67e74705SXin Li// RUN: c-index-test -code-completion-at=%s:17:7 %s | FileCheck -check-prefix=CHECK-CC2 %s
117*67e74705SXin Li// CHECK-CC2: ObjCInstanceMethodDecl:{TypedText abc}
118*67e74705SXin Li// CHECK-CC2-NEXT: ObjCInstanceMethodDecl:{TypedText getSelf}
119*67e74705SXin Li// CHECK-CC2: ObjCInstanceMethodDecl:{TypedText initWithInt}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}
120*67e74705SXin Li// CHECK-CC2: ObjCInstanceMethodDecl:{TypedText initWithTwoInts}{TypedText :}{LeftParen (}{Text inout }{Text int}{RightParen )}{Text x}{HorizontalSpace  }{TypedText second:}{LeftParen (}{Text int}{RightParen )}{Text y}
121*67e74705SXin Li// RUN: c-index-test -code-completion-at=%s:24:7 %s | FileCheck -check-prefix=CHECK-CC3 %s
122*67e74705SXin Li// CHECK-CC3: ObjCInstanceMethodDecl:{TypedText abc}
123*67e74705SXin Li// CHECK-CC3-NEXT: ObjCInstanceMethodDecl:{TypedText getSelf}
124*67e74705SXin Li// CHECK-CC3: ObjCInstanceMethodDecl:{TypedText init}
125*67e74705SXin Li// CHECK-CC3: ObjCInstanceMethodDecl:{TypedText initWithInt}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}
126*67e74705SXin Li// CHECK-CC3: ObjCInstanceMethodDecl:{TypedText initWithTwoInts}{TypedText :}{LeftParen (}{Text inout }{Text int}{RightParen )}{Text x}{HorizontalSpace  }{TypedText second:}{LeftParen (}{Text int}{RightParen )}{Text y}
127*67e74705SXin Li// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:33:3 %s | FileCheck -check-prefix=CHECK-CC4 %s
128*67e74705SXin Li// CHECK-CC4: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText abc}{HorizontalSpace  }{LeftBrace {}{VerticalSpace  }{Text return}{HorizontalSpace  }{Placeholder expression}{SemiColon ;}{VerticalSpace  }{RightBrace }} (42)
129*67e74705SXin Li// CHECK-CC4: ObjCInstanceMethodDecl:{LeftParen (}{Text int}{RightParen )}{TypedText getInt}{HorizontalSpace  }{LeftBrace {}{VerticalSpace
130*67e74705SXin Li// CHECK-CC4: ObjCInstanceMethodDecl:{LeftParen (}{Text int}{RightParen )}{TypedText getSecondValue}{HorizontalSpace  }{LeftBrace {}{VerticalSpace
131*67e74705SXin Li// CHECK-CC4: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText getSelf}{HorizontalSpace  }{LeftBrace {}{VerticalSpace  }{Text return}{HorizontalSpace  }{Placeholder expression}{SemiColon ;}{VerticalSpace  }{RightBrace }} (40)
132*67e74705SXin Li// CHECK-CC4: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText initWithInt}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace  }{LeftBrace {}{VerticalSpace
133*67e74705SXin Li// CHECK-CC4: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText initWithTwoInts}{TypedText :}{LeftParen (}{Text inout }{Text int}{RightParen )}{Text x}{HorizontalSpace  }{TypedText second:}{LeftParen (}{Text int}{RightParen )}{Text y}{HorizontalSpace  }{LeftBrace {}{VerticalSpace
134*67e74705SXin Li// CHECK-CC4: ObjCInstanceMethodDecl:{LeftParen (}{Text int}{RightParen )}{TypedText setValue}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace  }{LeftBrace {}{VerticalSpace
135*67e74705SXin Li// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:33:8 %s | FileCheck -check-prefix=CHECK-CC5 %s
136*67e74705SXin Li// CHECK-CC5: ObjCInstanceMethodDecl:{TypedText getInt}{HorizontalSpace  }{LeftBrace {}{VerticalSpace  }{Text return}{HorizontalSpace  }{Placeholder expression}{SemiColon ;}{VerticalSpace  }{RightBrace }} (42)
137*67e74705SXin Li// CHECK-CC5: ObjCInstanceMethodDecl:{TypedText getSecondValue}{HorizontalSpace  }{LeftBrace {}{VerticalSpace  }{Text return}{HorizontalSpace  }{Placeholder expression}{SemiColon ;}{VerticalSpace  }{RightBrace }} (40)
138*67e74705SXin Li// CHECK-CC5-NOT: {TypedText getSelf}{HorizontalSpace  }{LeftBrace {}{VerticalSpace
139*67e74705SXin Li// CHECK-CC5: ObjCInstanceMethodDecl:{TypedText setValue}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace  }{LeftBrace {}{VerticalSpace
140*67e74705SXin Li// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:37:7 %s | FileCheck -check-prefix=CHECK-CC6 %s
141*67e74705SXin Li// CHECK-CC6: ObjCInstanceMethodDecl:{TypedText abc}{HorizontalSpace  }{LeftBrace {}{VerticalSpace
142*67e74705SXin Li// CHECK-CC6: ObjCInstanceMethodDecl:{TypedText getSelf}{HorizontalSpace  }{LeftBrace {}{VerticalSpace  }{Text return}{HorizontalSpace  }{Placeholder expression}{SemiColon ;}{VerticalSpace  }{RightBrace }} (40)
143*67e74705SXin Li// CHECK-CC6: ObjCInstanceMethodDecl:{TypedText initWithInt}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace  }{LeftBrace {}{VerticalSpace
144*67e74705SXin Li// CHECK-CC6: ObjCInstanceMethodDecl:{TypedText initWithTwoInts}{TypedText :}{LeftParen (}{Text inout }{Text int}{RightParen )}{Text x}{HorizontalSpace  }{TypedText second:}{LeftParen (}{Text int}{RightParen )}{Text y}{HorizontalSpace  }{LeftBrace {}{VerticalSpace
145*67e74705SXin Li// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:42:3 %s | FileCheck -check-prefix=CHECK-CC7 %s
146*67e74705SXin Li// CHECK-CC7: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText abc}{HorizontalSpace  }{LeftBrace {}{VerticalSpace  }{Text return}{HorizontalSpace  }{Placeholder expression}{SemiColon ;}{VerticalSpace  }{RightBrace }} (42)
147*67e74705SXin Li// CHECK-CC7: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText categoryFunction}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace  }{LeftBrace {}{VerticalSpace
148*67e74705SXin Li// CHECK-CC7: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText getSelf}{HorizontalSpace  }{LeftBrace {}{VerticalSpace  }{Text return}{HorizontalSpace  }{Placeholder expression}{SemiColon ;}{VerticalSpace  }{RightBrace }} (42)
149*67e74705SXin Li// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:52:21 %s | FileCheck -check-prefix=CHECK-CC8 %s
150*67e74705SXin Li// CHECK-CC8: ObjCInstanceMethodDecl:{ResultType id}{Informative first:}{TypedText second2:}{Text (float)y2}{HorizontalSpace  }{TypedText third:}{Text (double)z} (35)
151*67e74705SXin Li// CHECK-CC8: ObjCInstanceMethodDecl:{ResultType void *}{Informative first:}{TypedText second3:}{Text (float)y3}{HorizontalSpace  }{TypedText third:}{Text (double)z} (35)
152*67e74705SXin Li// CHECK-CC8: ObjCInstanceMethodDecl:{ResultType int}{Informative first:}{TypedText second:}{Text (float)y}{HorizontalSpace  }{TypedText third:}{Text (double)z} (8)
153*67e74705SXin Li// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:52:19 %s | FileCheck -check-prefix=CHECK-CC9 %s
154*67e74705SXin Li// CHECK-CC9: NotImplemented:{TypedText x} (40)
155*67e74705SXin Li// CHECK-CC9: NotImplemented:{TypedText xx} (40)
156*67e74705SXin Li// CHECK-CC9: NotImplemented:{TypedText xxx} (40)
157*67e74705SXin Li// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:52:36 %s | FileCheck -check-prefix=CHECK-CCA %s
158*67e74705SXin Li// CHECK-CCA: NotImplemented:{TypedText y2} (40)
159*67e74705SXin Li// RUN: c-index-test -code-completion-at=%s:56:3 %s | FileCheck -check-prefix=CHECK-CCB %s
160*67e74705SXin Li// CHECK-CCB: ObjCInstanceMethodDecl:{LeftParen (}{Text int}{RightParen )}{TypedText first}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace  }{TypedText second2:}{LeftParen (}{Text float}{RightParen )}{Text y}{HorizontalSpace  }{TypedText third:}{LeftParen (}{Text double}{RightParen )}{Text z} (40)
161*67e74705SXin Li// RUN: c-index-test -code-completion-at=%s:56:8 %s | FileCheck -check-prefix=CHECK-CCC %s
162*67e74705SXin Li// CHECK-CCC: ObjCInstanceMethodDecl:{TypedText first}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace  }{TypedText second2:}{LeftParen (}{Text float}{RightParen )}{Text y}{HorizontalSpace  }{TypedText third:}{LeftParen (}{Text double}{RightParen )}{Text z} (40)
163*67e74705SXin Li// RUN: c-index-test -code-completion-at=%s:56:21 %s | FileCheck -check-prefix=CHECK-CCD %s
164*67e74705SXin Li// CHECK-CCD: ObjCInstanceMethodDecl:{ResultType id}{Informative first:}{TypedText second2:}{Text (float)y2}{HorizontalSpace  }{TypedText third:}{Text (double)z} (35)
165*67e74705SXin Li// CHECK-CCD: ObjCInstanceMethodDecl:{ResultType int}{Informative first:}{TypedText second2:}{Text (float)y}{HorizontalSpace  }{TypedText third:}{Text (double)z} (8)
166*67e74705SXin Li// CHECK-CCD: ObjCInstanceMethodDecl:{ResultType void *}{Informative first:}{TypedText second3:}{Text (float)y3}{HorizontalSpace  }{TypedText third:}{Text (double)z} (35)
167*67e74705SXin Li// CHECK-CCD: ObjCInstanceMethodDecl:{ResultType int}{Informative first:}{TypedText second:}{Text (float)y}{HorizontalSpace  }{TypedText third:}{Text (double)z} (8)
168*67e74705SXin Li// RUN: c-index-test -code-completion-at=%s:56:38 %s | FileCheck -check-prefix=CHECK-CCE %s
169*67e74705SXin Li// CHECK-CCE: ObjCInstanceMethodDecl:{ResultType id}{Informative first:}{Informative second2:}{TypedText third:}{Text (double)z} (35)
170*67e74705SXin Li// CHECK-CCE: ObjCInstanceMethodDecl:{ResultType int}{Informative first:}{Informative second2:}{TypedText third:}{Text (double)z} (8)
171*67e74705SXin Li// RUN: c-index-test -code-completion-at=%s:60:4 %s | FileCheck -check-prefix=CHECK-CCF %s
172*67e74705SXin Li// CHECK-CCF: ObjCInterfaceDecl:{TypedText A} (50)
173*67e74705SXin Li// CHECK-CCF: ObjCInterfaceDecl:{TypedText B} (50)
174*67e74705SXin Li// CHECK-CCF: NotImplemented:{TypedText bycopy} (40)
175*67e74705SXin Li// CHECK-CCF: NotImplemented:{TypedText byref} (40)
176*67e74705SXin Li// CHECK-CCF: NotImplemented:{TypedText in} (40)
177*67e74705SXin Li// CHECK-CCF: NotImplemented:{TypedText inout} (40)
178*67e74705SXin Li// CHECK-CCF: NotImplemented:{TypedText nonnull} (40)
179*67e74705SXin Li// CHECK-CCF: NotImplemented:{TypedText nullable} (40)
180*67e74705SXin Li// CHECK-CCF: NotImplemented:{TypedText oneway} (40)
181*67e74705SXin Li// CHECK-CCF: NotImplemented:{TypedText out} (40)
182*67e74705SXin Li// CHECK-CCF: NotImplemented:{TypedText unsigned} (50)
183*67e74705SXin Li// CHECK-CCF: NotImplemented:{TypedText void} (50)
184*67e74705SXin Li// CHECK-CCF: NotImplemented:{TypedText volatile} (50)
185*67e74705SXin Li// RUN: c-index-test -code-completion-at=%s:60:11 %s | FileCheck -check-prefix=CHECK-CCG %s
186*67e74705SXin Li// CHECK-CCG: ObjCInterfaceDecl:{TypedText A} (50)
187*67e74705SXin Li// CHECK-CCG: ObjCInterfaceDecl:{TypedText B} (50)
188*67e74705SXin Li// CHECK-CCG-NOT: NotImplemented:{TypedText bycopy} (40)
189*67e74705SXin Li// CHECK-CCG-NOT: NotImplemented:{TypedText byref} (40)
190*67e74705SXin Li// CHECK-CCG: NotImplemented:{TypedText in} (40)
191*67e74705SXin Li// CHECK-CCG: NotImplemented:{TypedText inout} (40)
192*67e74705SXin Li// CHECK-CCG-NOT: NotImplemented:{TypedText oneway} (40)
193*67e74705SXin Li// CHECK-CCG: NotImplemented:{TypedText out} (40)
194*67e74705SXin Li// CHECK-CCG: NotImplemented:{TypedText unsigned} (50)
195*67e74705SXin Li// CHECK-CCG: NotImplemented:{TypedText void} (50)
196*67e74705SXin Li// CHECK-CCG: NotImplemented:{TypedText volatile} (50)
197*67e74705SXin Li// RUN: c-index-test -code-completion-at=%s:60:24 %s | FileCheck -check-prefix=CHECK-CCF %s
198*67e74705SXin Li// RUN: c-index-test -code-completion-at=%s:60:26 %s | FileCheck -check-prefix=CHECK-CCH %s
199*67e74705SXin Li// CHECK-CCH: ObjCInterfaceDecl:{TypedText A} (50)
200*67e74705SXin Li// CHECK-CCH: ObjCInterfaceDecl:{TypedText B} (50)
201*67e74705SXin Li// CHECK-CCH: NotImplemented:{TypedText bycopy} (40)
202*67e74705SXin Li// CHECK-CCH: NotImplemented:{TypedText byref} (40)
203*67e74705SXin Li// CHECK-CCH-NOT: NotImplemented:{TypedText in} (40)
204*67e74705SXin Li// CHECK-CCH: NotImplemented:{TypedText inout} (40)
205*67e74705SXin Li// CHECK-CCH: NotImplemented:{TypedText oneway} (40)
206*67e74705SXin Li// CHECK-CCH: NotImplemented:{TypedText out} (40)
207*67e74705SXin Li// CHECK-CCH: NotImplemented:{TypedText unsigned} (50)
208*67e74705SXin Li// CHECK-CCH: NotImplemented:{TypedText void} (50)
209*67e74705SXin Li// CHECK-CCH: NotImplemented:{TypedText volatile} (50)
210*67e74705SXin Li
211*67e74705SXin Li// IBAction completion
212*67e74705SXin Li// RUN: c-index-test -code-completion-at=%s:5:4 %s | FileCheck -check-prefix=CHECK-IBACTION %s
213*67e74705SXin Li// CHECK-IBACTION: NotImplemented:{TypedText IBAction}{RightParen )}{Placeholder selector}{Colon :}{LeftParen (}{Text id}{RightParen )}{Text sender} (40)
214*67e74705SXin Li
215*67e74705SXin Li// <rdar://problem/8939352>
216*67e74705SXin Li// RUN: c-index-test -code-completion-at=%s:68:9 %s | FileCheck -check-prefix=CHECK-8939352 %s
217*67e74705SXin Li// CHECK-8939352: ObjCInstanceMethodDecl:{TypedText method}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace  }{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text y} (40)
218*67e74705SXin Li
219*67e74705SXin Li
220*67e74705SXin Li// RUN: c-index-test -code-completion-at=%s:72:2 %s | FileCheck -check-prefix=CHECK-ONEWAY %s
221*67e74705SXin Li// CHECK-ONEWAY: ObjCInstanceMethodDecl:{LeftParen (}{Text oneway }{Text void}{RightParen )}{TypedText method}{TypedText :}{LeftParen (}{Text in }{Text id}{RightParen )}{Text x} (40)
222*67e74705SXin Li
223*67e74705SXin Li// RUN: c-index-test -code-completion-at=%s:85:2 %s | FileCheck -check-prefix=CHECK-CLASSTY %s
224*67e74705SXin Li// CHECK-CLASSTY: ObjCInstanceMethodDecl:{LeftParen (}{Text Class<P1>}{RightParen )}{TypedText meth}
225*67e74705SXin Li// CHECK-CLASSTY: ObjCInstanceMethodDecl:{LeftParen (}{Text MyObject<P1> *}{RightParen )}{TypedText meth2}
226*67e74705SXin Li// CHECK-CLASSTY: ObjCInstanceMethodDecl:{LeftParen (}{Text MyObjectRef}{RightParen )}{TypedText meth3}
227*67e74705SXin Li
228*67e74705SXin Li// RUN: c-index-test -code-completion-at=%s:96:2 %s -target x86_64-apple-macosx10.7 | FileCheck -check-prefix=CHECK-NULLABILITY %s
229*67e74705SXin Li// CHECK-NULLABILITY: ObjCInstanceMethodDecl:{LeftParen (}{Text I2 *}{RightParen )}{TypedText produceI2}{TypedText :}{LeftParen (}{Text I2 *}{RightParen )}{Text i2} (40)
230*67e74705SXin Li// CHECK-NULLABILITY: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText prop}
231*67e74705SXin Li// CHECK-NULLABILITY: ObjCInstanceMethodDecl:{LeftParen (}{Text void (^)(int * _Nullable)}{RightParen )}{TypedText propWB}
232*67e74705SXin Li// CHECK-NULLABILITY: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText setProp}{TypedText :}{LeftParen (}{Text id}{RightParen )}{Text prop}
233*67e74705SXin Li// CHECK-NULLABILITY: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText setPropWB}{TypedText :}{LeftParen (}{Text void (^)(int * _Nullable)}{RightParen )}{Text propWB}
234*67e74705SXin Li// CHECK-NULLABILITY: ObjCInstanceMethodDecl:{LeftParen (}{Text int * _Nullable *}{RightParen )}{TypedText something}{TypedText :}{LeftParen (}{Text void (^)(int * _Nullable)}{RightParen )}{Text b}
235*67e74705SXin Li
236*67e74705SXin Li// RUN: c-index-test -code-completion-at=%s:107:2 %s -target x86_64-apple-macosx10.7 | FileCheck -check-prefix=CHECK-NULLABILITY2 %s
237*67e74705SXin Li// CHECK-NULLABILITY2: ObjCInstanceMethodDecl:{LeftParen (}{Text instancetype}{RightParen )}{TypedText getI3} (40)
238*67e74705SXin Li// CHECK-NULLABILITY2: ObjCInstanceMethodDecl:{LeftParen (}{Text I3 *}{RightParen )}{TypedText produceI3}{TypedText :}{LeftParen (}{Text I3 *}{RightParen )}{Text i3} (40)
239