summaryrefslogtreecommitdiffstats
path: root/test/Parser/block-pointer-decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Parser/block-pointer-decl.c')
-rw-r--r--test/Parser/block-pointer-decl.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/Parser/block-pointer-decl.c b/test/Parser/block-pointer-decl.c
new file mode 100644
index 0000000..7a21651
--- /dev/null
+++ b/test/Parser/block-pointer-decl.c
@@ -0,0 +1,26 @@
+// RUN: clang-cc -fsyntax-only -verify -parse-noop -fblocks %s
+
+struct blockStruct {
+ int (^a)(float, int);
+ int b;
+};
+
+int blockTaker (int (^myBlock)(int), int other_input)
+{
+ return 5 * myBlock (other_input);
+}
+
+int main (int argc, char **argv)
+{
+ int (^blockptr) (int) = ^(int inval) {
+ printf ("Inputs: %d, %d.\n", argc, inval);
+ return argc * inval;
+ };
+
+
+ argc = 10;
+ printf ("I got: %d.\n",
+ blockTaker (blockptr, 6));
+ return 0;
+}
+
OpenPOWER on IntegriCloud