blob: 9300a7999217aad17c34bd199a9ed82e95f28711 [file] [log] [blame]
Douglas Gregordc845342010-05-25 05:58:43 +00001/* Run lines are at the end, since line/column matter in this test. */
2
3@interface A
4- (void)method:(int)x;
5@end
6
7@implementation A
8- (void)method:(int)x {
9 A *a = [A method:1];
Douglas Gregor200b2922010-09-17 22:25:06 +000010 blarg * blah = wibble;
11 A *a2;
12 z = [a2 method:1];
Douglas Gregor94859892010-09-17 22:41:34 +000013 blah ? blech : [a2 method:1];
Douglas Gregorac5fd842010-09-18 01:28:11 +000014 (a * a2)([a2 method:1]);
Douglas Gregor833ba9c2010-09-18 02:10:40 +000015 B *a = [a2 method:1];
Douglas Gregordc845342010-05-25 05:58:43 +000016}
17@end
18
Douglas Gregor32be4a52010-10-11 21:37:58 +000019// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:20 %s 2>%t | FileCheck -check-prefix=CHECK-CC1 %s
Douglas Gregordc845342010-05-25 05:58:43 +000020// RUN: not grep error %t
21// CHECK-CC1: NotImplemented:{TypedText @encode}{LeftParen (}{Placeholder type-name}{RightParen )}
Douglas Gregor4710e5b2010-05-28 00:49:12 +000022// CHECK-CC1-NOT: NotImplemented:{TypedText _Bool}
Douglas Gregordc845342010-05-25 05:58:43 +000023// CHECK-CC1: VarDecl:{ResultType A *}{TypedText a}
24// CHECK-CC1: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )}
25
Douglas Gregor32be4a52010-10-11 21:37:58 +000026// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:10:24 %s | FileCheck -check-prefix=CHECK-CC2 %s
Douglas Gregor4710e5b2010-05-28 00:49:12 +000027// CHECK-CC2: NotImplemented:{TypedText @encode}{LeftParen (}{Placeholder type-name}{RightParen )}
28// CHECK-CC2: NotImplemented:{TypedText _Bool}
29// CHECK-CC2: VarDecl:{ResultType A *}{TypedText a}
30// CHECK-CC2: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )}
Douglas Gregor32be4a52010-10-11 21:37:58 +000031// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:12:11 %s | FileCheck -check-prefix=CHECK-CC3 %s
Douglas Gregor8ec904c2010-10-19 00:03:23 +000032// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType void}{TypedText method:}{Placeholder (int)} (32)
Douglas Gregor32be4a52010-10-11 21:37:58 +000033// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:13:22 %s | FileCheck -check-prefix=CHECK-CC3 %s
34// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:14:16 %s | FileCheck -check-prefix=CHECK-CC3 %s
35// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:15:14 %s | FileCheck -check-prefix=CHECK-CC3 %s