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 |
Douglas Gregor | 97fe61c | 2010-09-18 15:16:27 +0000 | [diff] [blame] | 5 | @interface A |
| 6 | - (int)method:(id)param1; |
| 7 | |
| 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 { |
John McCall | f85e193 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 13 | void foo(id (^block)(id x, A* y)); |
Douglas Gregor | a5450a0 | 2010-10-18 22:01:46 +0000 | [diff] [blame] | 14 | for(BOOL B = YES; ; ) { } |
Douglas Gregor | 97fe61c | 2010-09-18 15:16:27 +0000 | [diff] [blame] | 15 | } |
| 16 | @end |
| 17 | |
Douglas Gregor | b05496d | 2010-09-20 21:11:48 +0000 | [diff] [blame] | 18 | // RUN: c-index-test -code-completion-at=%s:13:2 %s | FileCheck -check-prefix=CHECK-CC1 %s |
Douglas Gregor | 97fe61c | 2010-09-18 15:16:27 +0000 | [diff] [blame] | 19 | // CHECK-CC1: NotImplemented:{ResultType SEL}{TypedText _cmd} (80) |
Douglas Gregor | 08f43cd | 2010-09-20 23:11:55 +0000 | [diff] [blame] | 20 | // CHECK-CC1: TypedefDecl:{TypedText BOOL} (50) |
| 21 | // CHECK-CC1: macro definition:{TypedText bool} (51) |
Douglas Gregor | b05496d | 2010-09-20 21:11:48 +0000 | [diff] [blame] | 22 | // CHECK-CC1: macro definition:{TypedText NO} (65) |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 23 | // CHECK-CC1: NotImplemented:{ResultType A *}{TypedText self} (34) |
Douglas Gregor | b05496d | 2010-09-20 21:11:48 +0000 | [diff] [blame] | 24 | // CHECK-CC1: macro definition:{TypedText YES} (65) |
Douglas Gregor | a5450a0 | 2010-10-18 22:01:46 +0000 | [diff] [blame] | 25 | // 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 Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 29 | // CHECK-CC2: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40) |
John McCall | f85e193 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 30 | // 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) |