[Sanitizer] Add rudimentary support for wide-character strings to scanf/printf interc...
[blocksruntime.git] / test / BlocksRuntime / dispatch_call_Block_with_release.c
blob9e06f69ba762b8682a3626abc9ab6fbda794da86
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.
7 #include <stdio.h>
8 #include <Block.h>
10 // CONFIG
12 void callsomething(const char *format, int argument) {
15 void
16 dispatch_call_Block_with_release2(void *block)
18 void (^b)(void) = (void (^)(void))block;
19 b();
20 Block_release(b);
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
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;