blob: 281b5e63f0ba84229ba693935835e5ad2dc517fc [file] [log] [blame]
Douglas Gregor83482d12010-08-24 16:15:59 +00001// The line and column layout of this test is significant. Run lines
2// are at the end.
3typedef void (^block_t)(float f, double d);
4void f(int (^block)(int x, int y));
5void g(block_t b);
6
7void test_f() {
8
9}
10
11@interface A
12- method:(int (^)(int x, int y))b;
13- method2:(block_t)b;
14@end
15
16void test_A(A *a) {
17 [a method:0];
18}
Douglas Gregor38276252010-09-08 22:47:51 +000019
20@interface B
21- method3:(int (^)(void))b;
22@end
23
24void test_B(B *b) {
25 [b method3:^int(void){ return 0; }];
26}
27
Douglas Gregor83482d12010-08-24 16:15:59 +000028// RUN: c-index-test -code-completion-at=%s:8:1 %s | FileCheck -check-prefix=CHECK-CC1 %s
Douglas Gregord475aad2010-09-20 21:25:19 +000029// CHECK-CC1: FunctionDecl:{ResultType void}{TypedText f}{LeftParen (}{Placeholder ^int(int x, int y)}{RightParen )} (50)
30// CHECK-CC1: FunctionDecl:{ResultType void}{TypedText g}{LeftParen (}{Placeholder ^(float f, double d)}{RightParen )} (50)
Douglas Gregor83482d12010-08-24 16:15:59 +000031// RUN: c-index-test -code-completion-at=%s:17:6 %s | FileCheck -check-prefix=CHECK-CC2 %s
Douglas Gregor38276252010-09-08 22:47:51 +000032// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText method2:}{Placeholder ^(float f, double d)} (20)
33// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText method:}{Placeholder ^int(int x, int y)} (20)
34// RUN: c-index-test -code-completion-at=%s:25:6 %s | FileCheck -check-prefix=CHECK-CC3 %s
35// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType id}{TypedText method3:}{Placeholder ^int} (20)