complete-at-exprstmt.m revision 140ab234c23f392d5422691c5de1ee3c15026def
1/* The run lines are below, because this test is line- and 2 column-number sensitive. */ 3// XFAIL: * 4@interface MyClass { int ivar; } 5- (int)myMethod:(int)arg; 6@end 7 8@implementation MyClass 9- (int)myMethod:(int)arg { 10 @synchronized (@encode(MyClass)) { } 11} 12@end 13 14@interface A 15+ (int)add:(int)x to:(int)y; 16+ (int)add:(int)x to:(int)y plus:(int)z; 17@end 18 19void f() { 20 @selector(add:to:); 21} 22 23// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:4 %s | FileCheck -check-prefix=CHECK-CC1 %s 24// CHECK-CC1: {TypedText encode}{LeftParen (}{Placeholder type-name}{RightParen )} 25// CHECK-CC1: {TypedText protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )} 26// CHECK-CC1: {TypedText selector}{LeftParen (}{Placeholder selector}{RightParen )} 27// CHECK-CC1: {TypedText synchronized}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }} 28// CHECK-CC1: {TypedText throw}{HorizontalSpace }{Placeholder expression} 29// CHECK-CC1: {TypedText try}{LeftBrace {}{Placeholder statements}{RightBrace }}{Text @catch}{LeftParen (}{Placeholder parameter}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }}{Text @finally}{LeftBrace {}{Placeholder statements}{RightBrace }} 30// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:19 %s | FileCheck -check-prefix=CHECK-CC2 %s 31// CHECK-CC2: {TypedText encode}{LeftParen (}{Placeholder type-name}{RightParen )} 32// CHECK-CC2: {TypedText protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )} 33// CHECK-CC2: {TypedText selector}{LeftParen (}{Placeholder selector}{RightParen )} 34// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:3 %s | FileCheck -check-prefix=CHECK-CC3 %s 35// CHECK-CC3: NotImplemented:{TypedText @encode}{LeftParen (}{Placeholder type-name}{RightParen )} 36// CHECK-CC3: NotImplemented:{TypedText @protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )} 37// CHECK-CC3: NotImplemented:{TypedText @selector}{LeftParen (}{Placeholder selector}{RightParen )} 38// CHECK-CC3: NotImplemented:{TypedText @synchronized}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }} 39// CHECK-CC3: NotImplemented:{TypedText @throw}{HorizontalSpace }{Placeholder expression} 40// 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 }} 41// CHECK-CC3: NotImplemented:{ResultType SEL}{TypedText _cmd} 42// CHECK-CC3: ParmDecl:{ResultType int}{TypedText arg} 43// CHECK-CC3: TypedefDecl:{TypedText Class} 44// CHECK-CC3: TypedefDecl:{TypedText id} 45// CHECK-CC3: ObjCIvarDecl:{ResultType int}{TypedText ivar} 46// CHECK-CC3: ObjCInterfaceDecl:{TypedText MyClass} 47// CHECK-CC3: TypedefDecl:{TypedText SEL} 48// CHECK-CC3: NotImplemented:{ResultType MyClass *}{TypedText self} 49// RUN: c-index-test -code-completion-at=%s:19:13 %s | FileCheck -check-prefix=CHECK-CC4 %s 50// CHECK-CC4: NotImplemented:{TypedText add:to:} (40) 51// CHECK-CC4: NotImplemented:{TypedText add:to:plus:} (40) 52// CHECK-CC4: NotImplemented:{TypedText myMethod:} (40) 53// RUN: c-index-test -code-completion-at=%s:19:17 %s | FileCheck -check-prefix=CHECK-CC5 %s 54// CHECK-CC5: NotImplemented:{Informative add:}{TypedText to:} (40) 55// CHECK-CC5: NotImplemented:{Informative add:}{TypedText to:plus:} (40) 56 57