Douglas Gregor | 83482d1 | 2010-08-24 16:15:59 +0000 | [diff] [blame^] | 1 | // The line and column layout of this test is significant. Run lines |
| 2 | // are at the end. |
| 3 | typedef void (^block_t)(float f, double d); |
| 4 | void f(int (^block)(int x, int y)); |
| 5 | void g(block_t b); |
| 6 | |
| 7 | void test_f() { |
| 8 | |
| 9 | } |
| 10 | |
| 11 | @interface A |
| 12 | - method:(int (^)(int x, int y))b; |
| 13 | - method2:(block_t)b; |
| 14 | @end |
| 15 | |
| 16 | void test_A(A *a) { |
| 17 | [a method:0]; |
| 18 | } |
| 19 | // RUN: c-index-test -code-completion-at=%s:8:1 %s | FileCheck -check-prefix=CHECK-CC1 %s |
| 20 | // CHECK-CC1: FunctionDecl:{ResultType void}{TypedText f}{LeftParen (}{Placeholder int (^)(int x, int y)}{RightParen )} (50) |
| 21 | // CHECK-CC1: FunctionDecl:{ResultType void}{TypedText g}{LeftParen (}{Placeholder void (^)(float f, double d)}{RightParen )} (50) |
| 22 | // RUN: c-index-test -code-completion-at=%s:17:6 %s | FileCheck -check-prefix=CHECK-CC2 %s |
| 23 | // CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText method2:}{Placeholder void (^)(float f, double d)} (20) |
| 24 | // CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText method:}{Placeholder int (^)(int x, int y)} (20) |