blob: 85370989fd83359e8b8b7715de8705ee3497db2c [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 Gregord8e8a582010-05-25 21:41:55 +000012// RUN: c-index-test -code-completion-at=%s:9:4 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s
Douglas Gregor9a0c85e2009-12-07 09:51:25 +000013// CHECK-CC1: {TypedText encode}{LeftParen (}{Placeholder type-name}{RightParen )}
14// CHECK-CC1: {TypedText protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )}
15// CHECK-CC1: {TypedText selector}{LeftParen (}{Placeholder selector}{RightParen )}
Douglas Gregor834389b2010-01-12 06:38:28 +000016// CHECK-CC1: {TypedText synchronized}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }}
Douglas Gregorfe0bdba2010-04-06 20:11:37 +000017// CHECK-CC1: {TypedText throw}{HorizontalSpace }{Placeholder expression}
Douglas Gregor9a0c85e2009-12-07 09:51:25 +000018// 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 Gregord8e8a582010-05-25 21:41:55 +000019// RUN: c-index-test -code-completion-at=%s:9:19 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC2 %s
Douglas Gregor9a0c85e2009-12-07 09:51:25 +000020// CHECK-CC2: {TypedText encode}{LeftParen (}{Placeholder type-name}{RightParen )}
21// CHECK-CC2: {TypedText protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )}
22// CHECK-CC2: {TypedText selector}{LeftParen (}{Placeholder selector}{RightParen )}
Douglas Gregord8e8a582010-05-25 21:41:55 +000023// RUN: c-index-test -code-completion-at=%s:9:3 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s
Douglas Gregorab0b4f12010-01-13 23:24:38 +000024// CHECK-CC3: NotImplemented:{TypedText @encode}{LeftParen (}{Placeholder type-name}{RightParen )}
25// CHECK-CC3: NotImplemented:{TypedText @protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )}
26// CHECK-CC3: NotImplemented:{TypedText @selector}{LeftParen (}{Placeholder selector}{RightParen )}
Douglas Gregorb6ac2452010-01-13 21:24:21 +000027// CHECK-CC3: NotImplemented:{TypedText @synchronized}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }}
Douglas Gregorfe0bdba2010-04-06 20:11:37 +000028// CHECK-CC3: NotImplemented:{TypedText @throw}{HorizontalSpace }{Placeholder expression}
Douglas Gregorb6ac2452010-01-13 21:24:21 +000029// 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 +000030// CHECK-CC3: NotImplemented:{ResultType SEL}{TypedText _cmd}
31// CHECK-CC3: ParmDecl:{ResultType int}{TypedText arg}
Douglas Gregorb6ac2452010-01-13 21:24:21 +000032// CHECK-CC3: TypedefDecl:{TypedText Class}
33// CHECK-CC3: TypedefDecl:{TypedText id}
Douglas Gregor1ca6ae82010-01-14 01:09:38 +000034// CHECK-CC3: ObjCIvarDecl:{ResultType int}{TypedText ivar}
Douglas Gregorb6ac2452010-01-13 21:24:21 +000035// CHECK-CC3: ObjCInterfaceDecl:{TypedText MyClass}
36// CHECK-CC3: TypedefDecl:{TypedText SEL}
Douglas Gregorab0b4f12010-01-13 23:24:38 +000037// CHECK-CC3: NotImplemented:{ResultType MyClass *}{TypedText self}