blob: dfa114dcc095a72a50434017b0e3149f2f5979fd [file] [log] [blame]
Douglas Gregorb05496d2010-09-20 21:11:48 +00001typedef signed char BOOL;
2#define YES ((BOOL)1)
3#define NO ((BOOL)0)
4#define bool _Bool
Douglas Gregor97fe61c2010-09-18 15:16:27 +00005@interface A
6- (int)method:(id)param1;
7
8@property int prop1;
9@end
John McCallf85e1932011-06-15 23:02:42 +000010__strong id global;
Douglas Gregor97fe61c2010-09-18 15:16:27 +000011@implementation A
12- (int)method:(id)param1 {
John McCallf85e1932011-06-15 23:02:42 +000013 void foo(id (^block)(id x, A* y));
Douglas Gregora5450a02010-10-18 22:01:46 +000014 for(BOOL B = YES; ; ) { }
Douglas Gregor97fe61c2010-09-18 15:16:27 +000015}
16@end
17
Douglas Gregorb05496d2010-09-20 21:11:48 +000018// RUN: c-index-test -code-completion-at=%s:13:2 %s | FileCheck -check-prefix=CHECK-CC1 %s
Douglas Gregor97fe61c2010-09-18 15:16:27 +000019// CHECK-CC1: NotImplemented:{ResultType SEL}{TypedText _cmd} (80)
Douglas Gregor08f43cd2010-09-20 23:11:55 +000020// CHECK-CC1: TypedefDecl:{TypedText BOOL} (50)
21// CHECK-CC1: macro definition:{TypedText bool} (51)
Douglas Gregorb05496d2010-09-20 21:11:48 +000022// CHECK-CC1: macro definition:{TypedText NO} (65)
Douglas Gregor8ec904c2010-10-19 00:03:23 +000023// CHECK-CC1: NotImplemented:{ResultType A *}{TypedText self} (34)
Douglas Gregorb05496d2010-09-20 21:11:48 +000024// CHECK-CC1: macro definition:{TypedText YES} (65)
Douglas Gregora5450a02010-10-18 22:01:46 +000025// RUN: c-index-test -code-completion-at=%s:14:7 %s | FileCheck -check-prefix=CHECK-CC2 %s
26// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:14:7 %s | FileCheck -check-prefix=CHECK-CC2 %s
27// CHECK-CC2: TypedefDecl:{TypedText BOOL} (50)
28// CHECK-CC2: NotImplemented:{TypedText char} (50)
Douglas Gregor8ec904c2010-10-19 00:03:23 +000029// CHECK-CC2: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40)
John McCallf85e1932011-06-15 23:02:42 +000030// RUN: c-index-test -code-completion-at=%s:15:1 -fobjc-arc -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC3 %s
31// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:15:1 -fobjc-arc -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC3 %s
32// CHECK-CC3: FunctionDecl:{ResultType void}{TypedText foo}{LeftParen (}{Placeholder ^id(id x, A *y)block}{RightParen )} (34)
33// CHECK-CC3: VarDecl:{ResultType id}{TypedText global} (50)
34// CHECK-CC3: ParmDecl:{ResultType id}{TypedText param1} (34)