blob: a6d767529af5cb48fb5750e6b20b8ea0d99df7fd [file] [log] [blame]
Douglas Gregor9a0c85e2009-12-07 09:51:25 +00001/* The run lines are below, because this test is line- and
2 column-number sensitive. */
Douglas Gregor1ca6ae82010-01-14 01:09:38 +00003@interface MyClass { int ivar; }
Douglas Gregor9a0c85e2009-12-07 09:51:25 +00004- (int)myMethod:(int)arg;
5@end
6
7@implementation MyClass
8- (int)myMethod:(int)arg {
9 @synchronized (@encode(MyClass)) { }
10}
11@end
Douglas Gregor458433d2010-08-26 15:07:07 +000012
13@interface A
14+ (int)add:(int)x to:(int)y;
15+ (int)add:(int)x to:(int)y plus:(int)z;
16@end
17
18void f() {
19 @selector(add:to:);
20}
21
Douglas Gregor32be4a52010-10-11 21:37:58 +000022// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:4 %s | FileCheck -check-prefix=CHECK-CC1 %s
Douglas Gregor9a0c85e2009-12-07 09:51:25 +000023// CHECK-CC1: {TypedText encode}{LeftParen (}{Placeholder type-name}{RightParen )}
24// CHECK-CC1: {TypedText protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )}
25// CHECK-CC1: {TypedText selector}{LeftParen (}{Placeholder selector}{RightParen )}
Douglas Gregor834389b2010-01-12 06:38:28 +000026// CHECK-CC1: {TypedText synchronized}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }}
Douglas Gregorfe0bdba2010-04-06 20:11:37 +000027// CHECK-CC1: {TypedText throw}{HorizontalSpace }{Placeholder expression}
Douglas Gregor9a0c85e2009-12-07 09:51:25 +000028// CHECK-CC1: {TypedText try}{LeftBrace {}{Placeholder statements}{RightBrace }}{Text @catch}{LeftParen (}{Placeholder parameter}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }}{Text @finally}{LeftBrace {}{Placeholder statements}{RightBrace }}
Douglas Gregor32be4a52010-10-11 21:37:58 +000029// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:19 %s | FileCheck -check-prefix=CHECK-CC2 %s
Douglas Gregor9a0c85e2009-12-07 09:51:25 +000030// CHECK-CC2: {TypedText encode}{LeftParen (}{Placeholder type-name}{RightParen )}
31// CHECK-CC2: {TypedText protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )}
32// CHECK-CC2: {TypedText selector}{LeftParen (}{Placeholder selector}{RightParen )}
Douglas Gregor32be4a52010-10-11 21:37:58 +000033// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:3 %s | FileCheck -check-prefix=CHECK-CC3 %s
Douglas Gregor8ca72082011-10-18 21:20:17 +000034// CHECK-CC3: NotImplemented:{ResultType char[]}{TypedText @encode}{LeftParen (}{Placeholder type-name}{RightParen )}
35// CHECK-CC3: NotImplemented:{ResultType Protocol *}{TypedText @protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )}
36// CHECK-CC3: NotImplemented:{ResultType SEL}{TypedText @selector}{LeftParen (}{Placeholder selector}{RightParen )}
Douglas Gregorb6ac2452010-01-13 21:24:21 +000037// CHECK-CC3: NotImplemented:{TypedText @synchronized}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }}
Douglas Gregorfe0bdba2010-04-06 20:11:37 +000038// CHECK-CC3: NotImplemented:{TypedText @throw}{HorizontalSpace }{Placeholder expression}
Douglas Gregorb6ac2452010-01-13 21:24:21 +000039// CHECK-CC3: NotImplemented:{TypedText @try}{LeftBrace {}{Placeholder statements}{RightBrace }}{Text @catch}{LeftParen (}{Placeholder parameter}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }}{Text @finally}{LeftBrace {}{Placeholder statements}{RightBrace }}
Douglas Gregorab0b4f12010-01-13 23:24:38 +000040// CHECK-CC3: NotImplemented:{ResultType SEL}{TypedText _cmd}
41// CHECK-CC3: ParmDecl:{ResultType int}{TypedText arg}
Douglas Gregorb6ac2452010-01-13 21:24:21 +000042// CHECK-CC3: TypedefDecl:{TypedText Class}
43// CHECK-CC3: TypedefDecl:{TypedText id}
Douglas Gregor1ca6ae82010-01-14 01:09:38 +000044// CHECK-CC3: ObjCIvarDecl:{ResultType int}{TypedText ivar}
Douglas Gregorb6ac2452010-01-13 21:24:21 +000045// CHECK-CC3: ObjCInterfaceDecl:{TypedText MyClass}
46// CHECK-CC3: TypedefDecl:{TypedText SEL}
Douglas Gregorab0b4f12010-01-13 23:24:38 +000047// CHECK-CC3: NotImplemented:{ResultType MyClass *}{TypedText self}
Douglas Gregor458433d2010-08-26 15:07:07 +000048// RUN: c-index-test -code-completion-at=%s:19:13 %s | FileCheck -check-prefix=CHECK-CC4 %s
Douglas Gregor8ec904c2010-10-19 00:03:23 +000049// CHECK-CC4: NotImplemented:{TypedText add:to:} (40)
50// CHECK-CC4: NotImplemented:{TypedText add:to:plus:} (40)
51// CHECK-CC4: NotImplemented:{TypedText myMethod:} (40)
Douglas Gregor458433d2010-08-26 15:07:07 +000052// RUN: c-index-test -code-completion-at=%s:19:17 %s | FileCheck -check-prefix=CHECK-CC5 %s
Douglas Gregor8ec904c2010-10-19 00:03:23 +000053// CHECK-CC5: NotImplemented:{Informative add:}{TypedText to:} (40)
54// CHECK-CC5: NotImplemented:{Informative add:}{TypedText to:plus:} (40)
Douglas Gregor458433d2010-08-26 15:07:07 +000055