minix/external/bsd/llvm/dist/clang/test/Parser/block-pointer-decl.c
Lionel Sambuc f4a2713ac8 Importing netbsd clang -- pristine
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
2014-07-28 17:05:57 +02:00

29 lines
512 B
C

// RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s
// expected-no-diagnostics
int printf(char const *, ...);
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;
}