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