19a0c85e640a08174569a303db22981612f05d385Douglas Gregor/* The run lines are below, because this test is line- and 29a0c85e640a08174569a303db22981612f05d385Douglas Gregor column-number sensitive. */ 31ca6ae865cc632e9f626faacd4937e666eb05f6bDouglas Gregor@interface MyClass { int ivar; } 49a0c85e640a08174569a303db22981612f05d385Douglas Gregor- (int)myMethod:(int)arg; 59a0c85e640a08174569a303db22981612f05d385Douglas Gregor@end 69a0c85e640a08174569a303db22981612f05d385Douglas Gregor 79a0c85e640a08174569a303db22981612f05d385Douglas Gregor@implementation MyClass 89a0c85e640a08174569a303db22981612f05d385Douglas Gregor- (int)myMethod:(int)arg { 99a0c85e640a08174569a303db22981612f05d385Douglas Gregor @synchronized (@encode(MyClass)) { } 109a0c85e640a08174569a303db22981612f05d385Douglas Gregor} 119a0c85e640a08174569a303db22981612f05d385Douglas Gregor@end 12458433d2f0f5c96a9e0d21decdd44bebccf20b11Douglas Gregor 13458433d2f0f5c96a9e0d21decdd44bebccf20b11Douglas Gregor@interface A 14458433d2f0f5c96a9e0d21decdd44bebccf20b11Douglas Gregor+ (int)add:(int)x to:(int)y; 15458433d2f0f5c96a9e0d21decdd44bebccf20b11Douglas Gregor+ (int)add:(int)x to:(int)y plus:(int)z; 16458433d2f0f5c96a9e0d21decdd44bebccf20b11Douglas Gregor@end 17458433d2f0f5c96a9e0d21decdd44bebccf20b11Douglas Gregor 18458433d2f0f5c96a9e0d21decdd44bebccf20b11Douglas Gregorvoid f() { 19458433d2f0f5c96a9e0d21decdd44bebccf20b11Douglas Gregor @selector(add:to:); 20458433d2f0f5c96a9e0d21decdd44bebccf20b11Douglas Gregor} 21458433d2f0f5c96a9e0d21decdd44bebccf20b11Douglas Gregor 2232be4a588fbb87d0d163ead49c42f5438bf0b2b7Douglas Gregor// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:4 %s | FileCheck -check-prefix=CHECK-CC1 %s 239a0c85e640a08174569a303db22981612f05d385Douglas Gregor// CHECK-CC1: {TypedText encode}{LeftParen (}{Placeholder type-name}{RightParen )} 249a0c85e640a08174569a303db22981612f05d385Douglas Gregor// CHECK-CC1: {TypedText protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )} 259a0c85e640a08174569a303db22981612f05d385Douglas Gregor// CHECK-CC1: {TypedText selector}{LeftParen (}{Placeholder selector}{RightParen )} 26834389b87451b24618513b907b4dfb5b00d211f3Douglas Gregor// CHECK-CC1: {TypedText synchronized}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }} 27fe0bdba44641c5d20e6b7c889545b087ff10179eDouglas Gregor// CHECK-CC1: {TypedText throw}{HorizontalSpace }{Placeholder expression} 289a0c85e640a08174569a303db22981612f05d385Douglas Gregor// CHECK-CC1: {TypedText try}{LeftBrace {}{Placeholder statements}{RightBrace }}{Text @catch}{LeftParen (}{Placeholder parameter}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }}{Text @finally}{LeftBrace {}{Placeholder statements}{RightBrace }} 2932be4a588fbb87d0d163ead49c42f5438bf0b2b7Douglas Gregor// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:19 %s | FileCheck -check-prefix=CHECK-CC2 %s 309a0c85e640a08174569a303db22981612f05d385Douglas Gregor// CHECK-CC2: {TypedText encode}{LeftParen (}{Placeholder type-name}{RightParen )} 319a0c85e640a08174569a303db22981612f05d385Douglas Gregor// CHECK-CC2: {TypedText protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )} 329a0c85e640a08174569a303db22981612f05d385Douglas Gregor// CHECK-CC2: {TypedText selector}{LeftParen (}{Placeholder selector}{RightParen )} 3332be4a588fbb87d0d163ead49c42f5438bf0b2b7Douglas Gregor// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:3 %s | FileCheck -check-prefix=CHECK-CC3 %s 348ca7208d0fb4dcbc5fa8cfeca6a1081ce69da8e0Douglas Gregor// CHECK-CC3: NotImplemented:{ResultType char[]}{TypedText @encode}{LeftParen (}{Placeholder type-name}{RightParen )} 358ca7208d0fb4dcbc5fa8cfeca6a1081ce69da8e0Douglas Gregor// CHECK-CC3: NotImplemented:{ResultType Protocol *}{TypedText @protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )} 368ca7208d0fb4dcbc5fa8cfeca6a1081ce69da8e0Douglas Gregor// CHECK-CC3: NotImplemented:{ResultType SEL}{TypedText @selector}{LeftParen (}{Placeholder selector}{RightParen )} 37b6ac2451bfed36206c5cec7217372c4299f67f2bDouglas Gregor// CHECK-CC3: NotImplemented:{TypedText @synchronized}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }} 38fe0bdba44641c5d20e6b7c889545b087ff10179eDouglas Gregor// CHECK-CC3: NotImplemented:{TypedText @throw}{HorizontalSpace }{Placeholder expression} 39b6ac2451bfed36206c5cec7217372c4299f67f2bDouglas Gregor// 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 }} 40ab0b4f1d66de54b4c3102b96d56964510361ba7dDouglas Gregor// CHECK-CC3: NotImplemented:{ResultType SEL}{TypedText _cmd} 41ab0b4f1d66de54b4c3102b96d56964510361ba7dDouglas Gregor// CHECK-CC3: ParmDecl:{ResultType int}{TypedText arg} 42b6ac2451bfed36206c5cec7217372c4299f67f2bDouglas Gregor// CHECK-CC3: TypedefDecl:{TypedText Class} 43b6ac2451bfed36206c5cec7217372c4299f67f2bDouglas Gregor// CHECK-CC3: TypedefDecl:{TypedText id} 441ca6ae865cc632e9f626faacd4937e666eb05f6bDouglas Gregor// CHECK-CC3: ObjCIvarDecl:{ResultType int}{TypedText ivar} 45b6ac2451bfed36206c5cec7217372c4299f67f2bDouglas Gregor// CHECK-CC3: ObjCInterfaceDecl:{TypedText MyClass} 46b6ac2451bfed36206c5cec7217372c4299f67f2bDouglas Gregor// CHECK-CC3: TypedefDecl:{TypedText SEL} 47ab0b4f1d66de54b4c3102b96d56964510361ba7dDouglas Gregor// CHECK-CC3: NotImplemented:{ResultType MyClass *}{TypedText self} 48458433d2f0f5c96a9e0d21decdd44bebccf20b11Douglas Gregor// RUN: c-index-test -code-completion-at=%s:19:13 %s | FileCheck -check-prefix=CHECK-CC4 %s 498ec904c151abf7ed0dc911258574a904ed97ff15Douglas Gregor// CHECK-CC4: NotImplemented:{TypedText add:to:} (40) 508ec904c151abf7ed0dc911258574a904ed97ff15Douglas Gregor// CHECK-CC4: NotImplemented:{TypedText add:to:plus:} (40) 518ec904c151abf7ed0dc911258574a904ed97ff15Douglas Gregor// CHECK-CC4: NotImplemented:{TypedText myMethod:} (40) 52458433d2f0f5c96a9e0d21decdd44bebccf20b11Douglas Gregor// RUN: c-index-test -code-completion-at=%s:19:17 %s | FileCheck -check-prefix=CHECK-CC5 %s 538ec904c151abf7ed0dc911258574a904ed97ff15Douglas Gregor// CHECK-CC5: NotImplemented:{Informative add:}{TypedText to:} (40) 548ec904c151abf7ed0dc911258574a904ed97ff15Douglas Gregor// CHECK-CC5: NotImplemented:{Informative add:}{TypedText to:plus:} (40) 55458433d2f0f5c96a9e0d21decdd44bebccf20b11Douglas Gregor 56