[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Parser / block-pointer-decl.c
blobd88daf3a870dd8d5df0d6c64bf9b9f81236a4039
1 // RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s
2 // expected-no-diagnostics
4 int printf(char const *, ...);
6 struct blockStruct {
7 int (^a)(float, int);
8 int b;
9 };
11 int blockTaker (int (^myBlock)(int), int other_input)
13 return 5 * myBlock (other_input);
16 int main (int argc, char **argv)
18 int (^blockptr) (int) = ^(int inval) {
19 printf ("Inputs: %d, %d.\n", argc, inval);
20 return argc * inval;
24 argc = 10;
25 printf ("I got: %d.\n",
26 blockTaker (blockptr, 6));
27 return 0;