2010-08-25 00:15:59 +08:00
|
|
|
// The line and column layout of this test is significant. Run lines
|
|
|
|
// are at the end.
|
|
|
|
typedef void (^block_t)(float f, double d);
|
|
|
|
void f(int (^block)(int x, int y));
|
|
|
|
void g(block_t b);
|
|
|
|
|
|
|
|
void test_f() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@interface A
|
|
|
|
- method:(int (^)(int x, int y))b;
|
|
|
|
- method2:(block_t)b;
|
|
|
|
@end
|
|
|
|
|
|
|
|
void test_A(A *a) {
|
|
|
|
[a method:0];
|
|
|
|
}
|
2010-09-09 06:47:51 +08:00
|
|
|
|
|
|
|
@interface B
|
|
|
|
- method3:(int (^)(void))b;
|
|
|
|
@end
|
|
|
|
|
|
|
|
void test_B(B *b) {
|
|
|
|
[b method3:^int(void){ return 0; }];
|
|
|
|
}
|
|
|
|
|
2010-10-03 07:49:58 +08:00
|
|
|
@interface C
|
2011-10-18 12:23:19 +08:00
|
|
|
- method4:(void(^)(void))arg;
|
|
|
|
- method5:(void(^)())arg5;
|
2010-10-03 07:49:58 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
void test_C(C *c) {
|
|
|
|
[c method4:^{}];
|
|
|
|
}
|
|
|
|
|
2011-10-18 12:23:19 +08:00
|
|
|
@interface D
|
|
|
|
- method6:(void(^)(block_t block))arg;
|
|
|
|
@end
|
|
|
|
|
|
|
|
void test_D(D *d) {
|
|
|
|
[d method6:0];
|
|
|
|
}
|
|
|
|
|
2015-07-07 14:20:22 +08:00
|
|
|
@interface I1
|
|
|
|
- method7:(int (^_Nullable)(int x, int y))b;
|
|
|
|
@end
|
|
|
|
void f2(int (^_Nullable block)(int x, int y));
|
|
|
|
void test_f2(I1 *o) {
|
|
|
|
[o method7:0];
|
|
|
|
}
|
|
|
|
|
2019-04-04 19:34:18 +08:00
|
|
|
// Crash regression test. Param info for broken function types isn't available.
|
|
|
|
typedef UnresolvedType *(^XXX)(float);
|
|
|
|
@interface Foo
|
|
|
|
-(void) foo:(XXX)arg;
|
|
|
|
@end
|
|
|
|
void testUnresolved(Foo* f) {
|
|
|
|
[f foo:0];
|
|
|
|
}
|
|
|
|
|
2010-08-25 00:15:59 +08:00
|
|
|
// RUN: c-index-test -code-completion-at=%s:8:1 %s | FileCheck -check-prefix=CHECK-CC1 %s
|
2010-10-03 07:49:58 +08:00
|
|
|
// CHECK-CC1: FunctionDecl:{ResultType void}{TypedText f}{LeftParen (}{Placeholder ^int(int x, int y)block}{RightParen )} (50)
|
|
|
|
// CHECK-CC1: FunctionDecl:{ResultType void}{TypedText g}{LeftParen (}{Placeholder ^(float f, double d)b}{RightParen )} (50)
|
2010-08-25 00:15:59 +08:00
|
|
|
// RUN: c-index-test -code-completion-at=%s:17:6 %s | FileCheck -check-prefix=CHECK-CC2 %s
|
2010-10-19 08:03:23 +08:00
|
|
|
// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText method2:}{Placeholder ^(float f, double d)b} (35)
|
|
|
|
// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText method:}{Placeholder ^int(int x, int y)b} (35)
|
2010-09-09 06:47:51 +08:00
|
|
|
// RUN: c-index-test -code-completion-at=%s:25:6 %s | FileCheck -check-prefix=CHECK-CC3 %s
|
2010-10-19 08:03:23 +08:00
|
|
|
// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType id}{TypedText method3:}{Placeholder ^int(void)b} (35)
|
2011-02-16 06:37:09 +08:00
|
|
|
// RUN: c-index-test -code-completion-at=%s:34:6 %s | FileCheck -check-prefix=CHECK-CC4 %s
|
2010-10-19 08:03:23 +08:00
|
|
|
// CHECK-CC4: ObjCInstanceMethodDecl:{ResultType id}{TypedText method4:}{Placeholder ^(void)arg} (35)
|
2011-02-16 06:37:09 +08:00
|
|
|
// CHECK-CC4: ObjCInstanceMethodDecl:{ResultType id}{TypedText method5:}{Placeholder ^(void)arg5} (35)
|
2010-10-19 05:34:55 +08:00
|
|
|
// RUN: c-index-test -code-completion-at=%s:25:15 %s | FileCheck -check-prefix=CHECK-CC5 %s
|
|
|
|
// CHECK-CC5: TypedefDecl:{TypedText block_t} (50)
|
|
|
|
// CHECK-CC5: TypedefDecl:{TypedText Class} (50)
|
|
|
|
// CHECK-CC5-NOT: test_A
|
|
|
|
// CHECK-CC5: {TypedText union} (50)
|
|
|
|
|
2011-10-18 12:23:19 +08:00
|
|
|
// RUN: c-index-test -code-completion-at=%s:42:6 %s | FileCheck -check-prefix=CHECK-CC6 %s
|
|
|
|
// CHECK-CC6: ObjCInstanceMethodDecl:{ResultType id}{TypedText method6:}{Placeholder ^(block_t block)arg} (35)
|
|
|
|
|
2015-07-07 14:20:22 +08:00
|
|
|
// RUN: c-index-test -code-completion-at=%s:50:1 %s | FileCheck -check-prefix=CHECK-CC7 %s
|
|
|
|
// CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f2}{LeftParen (}{Placeholder ^int(int x, int y)block}{RightParen )} (50)
|
|
|
|
// RUN: c-index-test -code-completion-at=%s:50:6 %s | FileCheck -check-prefix=CHECK-CC8 %s
|
|
|
|
// CHECK-CC8: ObjCInstanceMethodDecl:{ResultType id}{TypedText method7:}{Placeholder ^int(int x, int y)b} (35)
|
2019-04-04 19:34:18 +08:00
|
|
|
|
|
|
|
// RUN: c-index-test -code-completion-at=%s:59:6 %s | FileCheck -check-prefix=CHECK-CC9 %s
|
|
|
|
// CHECK-CC9: ObjCInstanceMethodDecl:{ResultType void}{TypedText foo:}{Placeholder ^int *(int)arg} (35)
|