blob: 2979b012c4492ba1dc5e796d5b6d67d0005cc12d [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify -parse-noop -fblocks %s
Steve Naroff5618bd42008-08-27 16:04:49 +00002
3struct blockStruct {
4 int (^a)(float, int);
5 int b;
6};
7
8int blockTaker (int (^myBlock)(int), int other_input)
9{
Steve Naroff296e8d52008-08-28 19:20:44 +000010 return 5 * myBlock (other_input);
Steve Naroff5618bd42008-08-27 16:04:49 +000011}
12
13int main (int argc, char **argv)
14{
Steve Naroff296e8d52008-08-28 19:20:44 +000015 int (^blockptr) (int) = ^(int inval) {
16 printf ("Inputs: %d, %d.\n", argc, inval);
17 return argc * inval;
18 };
19
20
21 argc = 10;
22 printf ("I got: %d.\n",
23 blockTaker (blockptr, 6));
Steve Naroff5618bd42008-08-27 16:04:49 +000024 return 0;
25}
26