1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s
2*f4a2713aSLionel Sambuc // expected-no-diagnostics
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuc int printf(char const *, ...);
5*f4a2713aSLionel Sambuc
6*f4a2713aSLionel Sambuc struct blockStruct {
7*f4a2713aSLionel Sambuc int (^a)(float, int);
8*f4a2713aSLionel Sambuc int b;
9*f4a2713aSLionel Sambuc };
10*f4a2713aSLionel Sambuc
11*f4a2713aSLionel Sambuc int blockTaker (int (^myBlock)(int), int other_input)
12*f4a2713aSLionel Sambuc {
13*f4a2713aSLionel Sambuc return 5 * myBlock (other_input);
14*f4a2713aSLionel Sambuc }
15*f4a2713aSLionel Sambuc
main(int argc,char ** argv)16*f4a2713aSLionel Sambuc int main (int argc, char **argv)
17*f4a2713aSLionel Sambuc {
18*f4a2713aSLionel Sambuc int (^blockptr) (int) = ^(int inval) {
19*f4a2713aSLionel Sambuc printf ("Inputs: %d, %d.\n", argc, inval);
20*f4a2713aSLionel Sambuc return argc * inval;
21*f4a2713aSLionel Sambuc };
22*f4a2713aSLionel Sambuc
23*f4a2713aSLionel Sambuc
24*f4a2713aSLionel Sambuc argc = 10;
25*f4a2713aSLionel Sambuc printf ("I got: %d.\n",
26*f4a2713aSLionel Sambuc blockTaker (blockptr, 6));
27*f4a2713aSLionel Sambuc return 0;
28*f4a2713aSLionel Sambuc }
29*f4a2713aSLionel Sambuc
30