summaryrefslogtreecommitdiffstats
path: root/test/Index/complete-blocks.m
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
committerdim <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
commit36c49e3f258dced101949edabd72e9bc3f1dedc4 (patch)
tree0bbe07708f7571f8b5291f6d7b96c102b7c99dee /test/Index/complete-blocks.m
parentfc84956ac8b7cd244ef30e7a4d4d38a58dec5904 (diff)
downloadFreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.zip
FreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.tar.gz
Vendor import of clang r114020 (from the release_28 branch):
http://llvm.org/svn/llvm-project/cfe/branches/release_28@114020 Approved by: rpaulo (mentor)
Diffstat (limited to 'test/Index/complete-blocks.m')
-rw-r--r--test/Index/complete-blocks.m24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/Index/complete-blocks.m b/test/Index/complete-blocks.m
new file mode 100644
index 0000000..7233efb
--- /dev/null
+++ b/test/Index/complete-blocks.m
@@ -0,0 +1,24 @@
+// 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];
+}
+// RUN: c-index-test -code-completion-at=%s:8:1 %s | FileCheck -check-prefix=CHECK-CC1 %s
+// CHECK-CC1: FunctionDecl:{ResultType void}{TypedText f}{LeftParen (}{Placeholder int (^)(int x, int y)}{RightParen )} (45)
+// CHECK-CC1: FunctionDecl:{ResultType void}{TypedText g}{LeftParen (}{Placeholder void (^)(float f, double d)}{RightParen )} (45)
+// RUN: c-index-test -code-completion-at=%s:17:6 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText method2:}{Placeholder void (^)(float f, double d)} (20)
+// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText method:}{Placeholder int (^)(int x, int y)} (20)
OpenPOWER on IntegriCloud