blob: 16eeda9bff4b6c96bdc521438bdf02867f7242ce [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
Ted Kremenekb3f75422012-03-06 20:06:06 +00005@interface NSArray + (id)arrayWithObjects:(const id [])objects count:(unsigned long)cnt; @end
Douglas Gregor97fe61c2010-09-18 15:16:27 +00006@interface A
7- (int)method:(id)param1;
Douglas Gregor97fe61c2010-09-18 15:16:27 +00008@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 {
Douglas Gregor30c42402011-09-27 22:38:19 +000013 void foo(bool (^block)(id x, A* y));
Douglas Gregora5450a02010-10-18 22:01:46 +000014 for(BOOL B = YES; ; ) { }
Ted Kremenekb3f75422012-03-06 20:06:06 +000015 @[ global ];
16 @{ global : global };
Douglas Gregor97fe61c2010-09-18 15:16:27 +000017}
18@end
19
Douglas Gregorb05496d2010-09-20 21:11:48 +000020// RUN: c-index-test -code-completion-at=%s:13:2 %s | FileCheck -check-prefix=CHECK-CC1 %s
Jordan Rose1f6e22d2012-06-15 18:19:56 +000021// CHECK-CC1: NotImplemented:{ResultType NSString *}{TypedText @"}{Placeholder string}{Text "} (40)
Douglas Gregor79615892012-07-17 23:24:47 +000022// CHECK-CC1: NotImplemented:{ResultType id}{TypedText @(}{Placeholder expression}{RightParen )} (40)
23// CHECK-CC1: NotImplemented:{ResultType NSArray *}{TypedText @[}{Placeholder objects, ...}{RightBracket ]} (40)
Douglas Gregor66a3d472012-08-17 05:40:05 +000024// CHECK-CC1: NotImplemented:{ResultType NSDictionary *}{TypedText @{}{Placeholder key}{Colon :}{HorizontalSpace }{Placeholder object, ...}{RightBrace }} (40)
Douglas Gregor97fe61c2010-09-18 15:16:27 +000025// CHECK-CC1: NotImplemented:{ResultType SEL}{TypedText _cmd} (80)
Douglas Gregor08f43cd2010-09-20 23:11:55 +000026// CHECK-CC1: TypedefDecl:{TypedText BOOL} (50)
27// CHECK-CC1: macro definition:{TypedText bool} (51)
Douglas Gregorb05496d2010-09-20 21:11:48 +000028// CHECK-CC1: macro definition:{TypedText NO} (65)
Douglas Gregor8ec904c2010-10-19 00:03:23 +000029// CHECK-CC1: NotImplemented:{ResultType A *}{TypedText self} (34)
Douglas Gregorb05496d2010-09-20 21:11:48 +000030// CHECK-CC1: macro definition:{TypedText YES} (65)
Douglas Gregora5450a02010-10-18 22:01:46 +000031// RUN: c-index-test -code-completion-at=%s:14:7 %s | FileCheck -check-prefix=CHECK-CC2 %s
32// 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
33// CHECK-CC2: TypedefDecl:{TypedText BOOL} (50)
34// CHECK-CC2: NotImplemented:{TypedText char} (50)
Douglas Gregor8ca72082011-10-18 21:20:17 +000035// CHECK-CC2: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40)
John McCallf85e1932011-06-15 23:02:42 +000036// RUN: c-index-test -code-completion-at=%s:15:1 -fobjc-arc -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC3 %s
37// 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
Douglas Gregor30c42402011-09-27 22:38:19 +000038// CHECK-CC3: FunctionDecl:{ResultType void}{TypedText foo}{LeftParen (}{Placeholder ^bool(id x, A *y)block}{RightParen )} (34)
John McCallf85e1932011-06-15 23:02:42 +000039// CHECK-CC3: VarDecl:{ResultType id}{TypedText global} (50)
40// CHECK-CC3: ParmDecl:{ResultType id}{TypedText param1} (34)
Ted Kremenekb3f75422012-03-06 20:06:06 +000041
42// RUN: c-index-test -code-completion-at=%s:15:5 %s | FileCheck -check-prefix=CHECK-CC4 %s
43// RUN: c-index-test -code-completion-at=%s:16:5 %s | FileCheck -check-prefix=CHECK-CC4 %s
44// RUN: c-index-test -code-completion-at=%s:16:14 %s | FileCheck -check-prefix=CHECK-CC4 %s
Douglas Gregor79615892012-07-17 23:24:47 +000045// CHECK-CC4: NotImplemented:{ResultType NSArray *}{TypedText @[}{Placeholder objects, ...}{RightBracket ]} (40)
Douglas Gregor66a3d472012-08-17 05:40:05 +000046// CHECK-CC4: NotImplemented:{ResultType NSDictionary *}{TypedText @{}{Placeholder key}{Colon :}{HorizontalSpace }{Placeholder object, ...}{RightBrace }} (40)
Ted Kremenekb3f75422012-03-06 20:06:06 +000047// CHECK-CC4: NotImplemented:{ResultType SEL}{TypedText _cmd} (80)
48// CHECK-CC4: macro definition:{TypedText bool} (51)
49// CHECK-CC4: macro definition:{TypedText NO} (65)
50// CHECK-CC4: NotImplemented:{ResultType A *}{TypedText self} (34)
51// CHECK-CC4: macro definition:{TypedText YES} (65)