1typedef signed char BOOL;
2#define YES ((BOOL)1)
3#define NO ((BOOL)0)
4#define bool _Bool
5@interface NSArray + (id)arrayWithObjects:(const id [])objects count:(unsigned long)cnt; @end
6@interface A
7- (int)method:(id)param1;
8@property int prop1;
9@end
10__strong id global;
11@implementation A
12- (int)method:(id)param1 {
13  void foo(bool (^block)(id x, A* y));
14  for(BOOL B = YES; ; ) { }
15  @[ global ];
16  @{ global : global };
17}
18@end
19
20// RUN: c-index-test -code-completion-at=%s:13:2 %s | FileCheck -check-prefix=CHECK-CC1 %s
21// CHECK-CC1: NotImplemented:{ResultType NSString *}{TypedText @"}{Placeholder string}{Text "} (40)
22// CHECK-CC1: NotImplemented:{ResultType id}{TypedText @(}{Placeholder expression}{RightParen )} (40)
23// CHECK-CC1: NotImplemented:{ResultType NSArray *}{TypedText @[}{Placeholder objects, ...}{RightBracket ]} (40)
24// CHECK-CC1: NotImplemented:{ResultType NSDictionary *}{TypedText @{}{Placeholder key}{Colon :}{HorizontalSpace  }{Placeholder object, ...}{RightBrace }} (40)
25// CHECK-CC1: NotImplemented:{ResultType SEL}{TypedText _cmd} (80)
26// CHECK-CC1: TypedefDecl:{TypedText BOOL} (50)
27// CHECK-CC1: macro definition:{TypedText bool} (51)
28// CHECK-CC1: macro definition:{TypedText NO} (65)
29// CHECK-CC1: NotImplemented:{ResultType A *}{TypedText self} (34)
30// CHECK-CC1: macro definition:{TypedText YES} (65)
31// 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)
35// CHECK-CC2: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40)
36// 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
38// CHECK-CC3: FunctionDecl:{ResultType void}{TypedText foo}{LeftParen (}{Placeholder ^bool(id x, A *y)block}{RightParen )} (34)
39// CHECK-CC3: VarDecl:{ResultType id}{TypedText global} (50)
40// CHECK-CC3: ParmDecl:{ResultType id}{TypedText param1} (34)
41
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
45// CHECK-CC4: NotImplemented:{ResultType NSArray *}{TypedText @[}{Placeholder objects, ...}{RightBracket ]} (40)
46// CHECK-CC4: NotImplemented:{ResultType NSDictionary *}{TypedText @{}{Placeholder key}{Colon :}{HorizontalSpace  }{Placeholder object, ...}{RightBrace }} (40)
47// 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)
52