Douglas Gregor | b05496d | 2010-09-20 21:11:48 +0000 | [diff] [blame] | 1 | typedef signed char BOOL; |
| 2 | #define YES ((BOOL)1) |
| 3 | #define NO ((BOOL)0) |
| 4 | #define bool _Bool |
Ted Kremenek | b3f7542 | 2012-03-06 20:06:06 +0000 | [diff] [blame] | 5 | @interface NSArray + (id)arrayWithObjects:(const id [])objects count:(unsigned long)cnt; @end |
Douglas Gregor | 97fe61c | 2010-09-18 15:16:27 +0000 | [diff] [blame] | 6 | @interface A |
| 7 | - (int)method:(id)param1; |
Douglas Gregor | 97fe61c | 2010-09-18 15:16:27 +0000 | [diff] [blame] | 8 | @property int prop1; |
| 9 | @end |
John McCall | f85e193 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 10 | __strong id global; |
Douglas Gregor | 97fe61c | 2010-09-18 15:16:27 +0000 | [diff] [blame] | 11 | @implementation A |
| 12 | - (int)method:(id)param1 { |
Douglas Gregor | 30c4240 | 2011-09-27 22:38:19 +0000 | [diff] [blame] | 13 | void foo(bool (^block)(id x, A* y)); |
Douglas Gregor | a5450a0 | 2010-10-18 22:01:46 +0000 | [diff] [blame] | 14 | for(BOOL B = YES; ; ) { } |
Ted Kremenek | b3f7542 | 2012-03-06 20:06:06 +0000 | [diff] [blame] | 15 | @[ global ]; |
| 16 | @{ global : global }; |
Douglas Gregor | 97fe61c | 2010-09-18 15:16:27 +0000 | [diff] [blame] | 17 | } |
| 18 | @end |
| 19 | |
Douglas Gregor | b05496d | 2010-09-20 21:11:48 +0000 | [diff] [blame] | 20 | // RUN: c-index-test -code-completion-at=%s:13:2 %s | FileCheck -check-prefix=CHECK-CC1 %s |
Jordan Rose | 1f6e22d | 2012-06-15 18:19:56 +0000 | [diff] [blame] | 21 | // CHECK-CC1: NotImplemented:{ResultType NSString *}{TypedText @"}{Placeholder string}{Text "} (40) |
Douglas Gregor | 7961589 | 2012-07-17 23:24:47 +0000 | [diff] [blame] | 22 | // CHECK-CC1: NotImplemented:{ResultType id}{TypedText @(}{Placeholder expression}{RightParen )} (40) |
| 23 | // CHECK-CC1: NotImplemented:{ResultType NSArray *}{TypedText @[}{Placeholder objects, ...}{RightBracket ]} (40) |
Douglas Gregor | 66a3d47 | 2012-08-17 05:40:05 +0000 | [diff] [blame] | 24 | // CHECK-CC1: NotImplemented:{ResultType NSDictionary *}{TypedText @{}{Placeholder key}{Colon :}{HorizontalSpace }{Placeholder object, ...}{RightBrace }} (40) |
Douglas Gregor | 97fe61c | 2010-09-18 15:16:27 +0000 | [diff] [blame] | 25 | // CHECK-CC1: NotImplemented:{ResultType SEL}{TypedText _cmd} (80) |
Douglas Gregor | 08f43cd | 2010-09-20 23:11:55 +0000 | [diff] [blame] | 26 | // CHECK-CC1: TypedefDecl:{TypedText BOOL} (50) |
| 27 | // CHECK-CC1: macro definition:{TypedText bool} (51) |
Douglas Gregor | b05496d | 2010-09-20 21:11:48 +0000 | [diff] [blame] | 28 | // CHECK-CC1: macro definition:{TypedText NO} (65) |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 29 | // CHECK-CC1: NotImplemented:{ResultType A *}{TypedText self} (34) |
Douglas Gregor | b05496d | 2010-09-20 21:11:48 +0000 | [diff] [blame] | 30 | // CHECK-CC1: macro definition:{TypedText YES} (65) |
Douglas Gregor | a5450a0 | 2010-10-18 22:01:46 +0000 | [diff] [blame] | 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) |
Douglas Gregor | 8ca7208 | 2011-10-18 21:20:17 +0000 | [diff] [blame] | 35 | // CHECK-CC2: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40) |
John McCall | f85e193 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 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 |
Douglas Gregor | 30c4240 | 2011-09-27 22:38:19 +0000 | [diff] [blame] | 38 | // CHECK-CC3: FunctionDecl:{ResultType void}{TypedText foo}{LeftParen (}{Placeholder ^bool(id x, A *y)block}{RightParen )} (34) |
John McCall | f85e193 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 39 | // CHECK-CC3: VarDecl:{ResultType id}{TypedText global} (50) |
| 40 | // CHECK-CC3: ParmDecl:{ResultType id}{TypedText param1} (34) |
Ted Kremenek | b3f7542 | 2012-03-06 20:06:06 +0000 | [diff] [blame] | 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 |
Douglas Gregor | 7961589 | 2012-07-17 23:24:47 +0000 | [diff] [blame] | 45 | // CHECK-CC4: NotImplemented:{ResultType NSArray *}{TypedText @[}{Placeholder objects, ...}{RightBracket ]} (40) |
Douglas Gregor | 66a3d47 | 2012-08-17 05:40:05 +0000 | [diff] [blame] | 46 | // CHECK-CC4: NotImplemented:{ResultType NSDictionary *}{TypedText @{}{Placeholder key}{Colon :}{HorizontalSpace }{Placeholder object, ...}{RightBrace }} (40) |
Ted Kremenek | b3f7542 | 2012-03-06 20:06:06 +0000 | [diff] [blame] | 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) |