• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 //                     The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 
7 #include <stdio.h>
8 #include <Block.h>
9 
10 // CONFIG
11 
callsomething(const char * format,int argument)12 void callsomething(const char *format, int argument) {
13 }
14 
15 void
dispatch_call_Block_with_release2(void * block)16 dispatch_call_Block_with_release2(void *block)
17 {
18         void (^b)(void) = (void (^)(void))block;
19         b();
20         Block_release(b);
21 }
22 
main(int argc,char * argv[])23 int main(int argc, char *argv[]) {
24      void (^b1)(void) = ^{ callsomething("argc is %d\n", argc); };
25      void (^b2)(void) = ^{ callsomething("hellow world\n", 0); }; // global block now
26 
27      dispatch_call_Block_with_release2(Block_copy(b1));
28      dispatch_call_Block_with_release2(Block_copy(b2));
29      printf("%s: Success\n", argv[0]);
30      return 0;
31 }
32