etc/services - sync with NetBSD-8
[minix.git] / external / bsd / llvm / dist / clang / test / Index / complete-blocks.m
blobcb507e2be34ee4d1c93e28079770b3672298cd3f
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);
7 void test_f() {
11 @interface A
12 - method:(int (^)(int x, int y))b;
13 - method2:(block_t)b;
14 @end
16 void test_A(A *a) {
17   [a method:0];
20 @interface B
21 - method3:(int (^)(void))b;
22 @end
24 void test_B(B *b) {
25   [b method3:^int(void){ return 0; }];
28 @interface C
29 - method4:(void(^)(void))arg;
30 - method5:(void(^)())arg5;
31 @end
33 void test_C(C *c) {
34   [c method4:^{}];
37 @interface D
38 - method6:(void(^)(block_t block))arg;
39 @end
41 void test_D(D *d) {
42   [d method6:0];
45 // RUN: c-index-test -code-completion-at=%s:8:1 %s | FileCheck -check-prefix=CHECK-CC1 %s
46 // CHECK-CC1: FunctionDecl:{ResultType void}{TypedText f}{LeftParen (}{Placeholder ^int(int x, int y)block}{RightParen )} (50)
47 // CHECK-CC1: FunctionDecl:{ResultType void}{TypedText g}{LeftParen (}{Placeholder ^(float f, double d)b}{RightParen )} (50)
48 // RUN: c-index-test -code-completion-at=%s:17:6 %s | FileCheck -check-prefix=CHECK-CC2 %s
49 // CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText method2:}{Placeholder ^(float f, double d)b} (35)
50 // CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText method:}{Placeholder ^int(int x, int y)b} (35)
51 // RUN: c-index-test -code-completion-at=%s:25:6 %s | FileCheck -check-prefix=CHECK-CC3 %s
52 // CHECK-CC3: ObjCInstanceMethodDecl:{ResultType id}{TypedText method3:}{Placeholder ^int(void)b} (35)
53 // RUN: c-index-test -code-completion-at=%s:34:6 %s | FileCheck -check-prefix=CHECK-CC4 %s
54 // CHECK-CC4: ObjCInstanceMethodDecl:{ResultType id}{TypedText method4:}{Placeholder ^(void)arg} (35)
55 // CHECK-CC4: ObjCInstanceMethodDecl:{ResultType id}{TypedText method5:}{Placeholder ^(void)arg5} (35)
56 // RUN: c-index-test -code-completion-at=%s:25:15 %s | FileCheck -check-prefix=CHECK-CC5 %s
57 // CHECK-CC5: TypedefDecl:{TypedText block_t} (50)
58 // CHECK-CC5: TypedefDecl:{TypedText Class} (50)
59 // CHECK-CC5-NOT: test_A
60 // CHECK-CC5: {TypedText union} (50)
62 // RUN: c-index-test -code-completion-at=%s:42:6 %s | FileCheck -check-prefix=CHECK-CC6 %s
63 // CHECK-CC6: ObjCInstanceMethodDecl:{ResultType id}{TypedText method6:}{Placeholder ^(block_t block)arg} (35)