blob: 802b360f0049ae8b2eeaeda5201764356feb54fd [file] [log] [blame]
Douglas Gregore8f5a172010-04-07 00:21:17 +00001/* Note: the RUN lines are near the end of the file, since line/column
2 matter for this test. */
3
4@protocol P1
5- (id)abc;
6- (id)initWithInt:(int)x;
7- (id)initWithTwoInts:(int)x second:(int)y;
8- (int)getInt;
9- (id)getSelf;
10@end
11
12@protocol P2<P1>
13+ (id)alloc;
14@end
15
16@interface A <P1>
17- (id)init;
18- (int)getValue;
19@end
20
21@interface B : A<P2>
22- (id)initWithInt:(int)x;
23- (int)getSecondValue;
24- (id)getSelf;
25- (int)setValue:(int)x;
26@end
27
28@interface B (FooBar)
29- (id)categoryFunction:(int)x;
30@end
31
32@implementation B
33- (int)getSecondValue { return 0; }
34- (id)init { return self; }
35- (id)getSelf { return self; }
36- (void)setValue:(int)x { }
37- (id)initWithTwoInts:(int)x second:(int)y { return self; }
38+ (id)alloc { return 0; }
39@end
40
41@implementation B (FooBar)
42- (id)categoryFunction:(int)x { return self; }
43@end
44
Douglas Gregor1f5537a2010-07-08 23:20:03 +000045@interface C
46- (int)first:(int)x second:(float)y third:(double)z;
47- (id)first:(int)x second2:(float)y third:(double)z;
48- (void*)first:(int)x second3:(float)y third:(double)z;
49@end
50
51@interface D
52- (int)first:(int)x second4:(float)y third:(double)z;
53@end
54
Douglas Gregore8f5a172010-04-07 00:21:17 +000055// RUN: c-index-test -code-completion-at=%s:17:3 %s | FileCheck -check-prefix=CHECK-CC1 %s
56// CHECK-CC1: NotImplemented:{LeftParen (}{Text id}{RightParen )}{TypedText abc}
57// CHECK-CC1: NotImplemented:{LeftParen (}{Text int}{RightParen )}{TypedText getInt}
58// CHECK-CC1: NotImplemented:{LeftParen (}{Text id}{RightParen )}{TypedText getSelf}
59// CHECK-CC1: NotImplemented:{LeftParen (}{Text id}{RightParen )}{TypedText initWithInt}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text x}
60// CHECK-CC1: NotImplemented:{LeftParen (}{Text id}{RightParen )}{TypedText initWithTwoInts}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{Text second}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text y}
61// RUN: c-index-test -code-completion-at=%s:17:7 %s | FileCheck -check-prefix=CHECK-CC2 %s
62// CHECK-CC2: NotImplemented:{TypedText abc}
63// CHECK-CC2-NEXT: NotImplemented:{TypedText getSelf}
64// CHECK-CC2: NotImplemented:{TypedText initWithInt}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text x}
65// CHECK-CC2: NotImplemented:{TypedText initWithTwoInts}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{Text second}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text y}
66// RUN: c-index-test -code-completion-at=%s:24:7 %s | FileCheck -check-prefix=CHECK-CC3 %s
67// CHECK-CC3: NotImplemented:{TypedText abc}
68// CHECK-CC3-NEXT: NotImplemented:{TypedText getSelf}
69// CHECK-CC3: NotImplemented:{TypedText init}
70// CHECK-CC3: NotImplemented:{TypedText initWithInt}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text x}
71// CHECK-CC3: NotImplemented:{TypedText initWithTwoInts}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{Text second}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text y}
Douglas Gregor447107d2010-05-28 00:57:46 +000072// RUN: c-index-test -code-completion-at=%s:33:3 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC4 %s
73// CHECK-CC4: NotImplemented:{LeftParen (}{Text id}{RightParen )}{TypedText abc}
Douglas Gregore8f5a172010-04-07 00:21:17 +000074// CHECK-CC4: NotImplemented:{LeftParen (}{Text int}{RightParen )}{TypedText getInt}{HorizontalSpace }{LeftBrace {}{VerticalSpace
75// CHECK-CC4: NotImplemented:{LeftParen (}{Text int}{RightParen )}{TypedText getSecondValue}{HorizontalSpace }{LeftBrace {}{VerticalSpace
76// CHECK-CC4: NotImplemented:{LeftParen (}{Text id}{RightParen )}{TypedText getSelf}{HorizontalSpace }{LeftBrace {}{VerticalSpace
77// CHECK-CC4: NotImplemented:{LeftParen (}{Text id}{RightParen )}{TypedText initWithInt}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{LeftBrace {}{VerticalSpace
78// CHECK-CC4: NotImplemented:{LeftParen (}{Text id}{RightParen )}{TypedText initWithTwoInts}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{Text second}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text y}{HorizontalSpace }{LeftBrace {}{VerticalSpace
79// CHECK-CC4: NotImplemented:{LeftParen (}{Text int}{RightParen )}{TypedText setValue}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{LeftBrace {}{VerticalSpace
Douglas Gregor447107d2010-05-28 00:57:46 +000080// RUN: c-index-test -code-completion-at=%s:33:8 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC5 %s
Douglas Gregore8f5a172010-04-07 00:21:17 +000081// CHECK-CC5: NotImplemented:{TypedText getInt}{HorizontalSpace }{LeftBrace {}{VerticalSpace
82// CHECK-CC5: NotImplemented:{TypedText getSecondValue}{HorizontalSpace }{LeftBrace {}{VerticalSpace
83// CHECK-CC5-NOT: {TypedText getSelf}{HorizontalSpace }{LeftBrace {}{VerticalSpace
84// CHECK-CC5: NotImplemented:{TypedText setValue}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{LeftBrace {}{VerticalSpace
Douglas Gregor447107d2010-05-28 00:57:46 +000085// RUN: c-index-test -code-completion-at=%s:37:7 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC6 %s
Douglas Gregore8f5a172010-04-07 00:21:17 +000086// CHECK-CC6: NotImplemented:{TypedText abc}{HorizontalSpace }{LeftBrace {}{VerticalSpace
87// CHECK-CC6-NOT: getSelf
88// CHECK-CC6: NotImplemented:{TypedText initWithInt}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{LeftBrace {}{VerticalSpace
89// CHECK-CC6: NotImplemented:{TypedText initWithTwoInts}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{Text second}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text y}{HorizontalSpace }{LeftBrace {}{VerticalSpace
Douglas Gregor447107d2010-05-28 00:57:46 +000090// RUN: c-index-test -code-completion-at=%s:42:3 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC7 %s
Douglas Gregore8f5a172010-04-07 00:21:17 +000091// CHECK-CC7: NotImplemented:{LeftParen (}{Text id}{RightParen )}{TypedText categoryFunction}{Colon :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{LeftBrace {}{VerticalSpace
Douglas Gregor1f5537a2010-07-08 23:20:03 +000092// RUN: c-index-test -code-completion-at=%s:52:21 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC8 %s
93// CHECK-CC8: ObjCInstanceMethodDecl:{ResultType id}{Informative first:}{TypedText second2:}{Text (float)y}{HorizontalSpace }{Text third:}{Text (double)z} (20)
94// CHECK-CC8: ObjCInstanceMethodDecl:{ResultType void *}{Informative first:}{TypedText second3:}{Text (float)y}{HorizontalSpace }{Text third:}{Text (double)z} (20)
95// CHECK-CC8: ObjCInstanceMethodDecl:{ResultType int}{Informative first:}{TypedText second:}{Text (float)y}{HorizontalSpace }{Text third:}{Text (double)z} (5)
96
Douglas Gregore8f5a172010-04-07 00:21:17 +000097