[Sanitizer] Add rudimentary support for wide-character strings to scanf/printf interc...
[blocksruntime.git] / test / BlocksRuntime / nullblockisa.c
blobba0282e820841aa4810c8b47bdbbb04c07a83e39
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 //
8 // nullblockisa.m
9 // testObjects
11 // Created by Blaine Garst on 9/24/08.
13 // CONFIG rdar://6244520
17 #include <stdio.h>
18 #include <stdlib.h>
19 #include <Block_private.h>
22 void check(void (^b)(void)) {
23 struct _custom {
24 struct Block_layout layout;
25 struct Block_byref *innerp;
26 } *custom = (struct _custom *)(void *)(b);
27 //printf("block is at %p, size is %lx, inner is %p\n", (void *)b, Block_size(b), innerp);
28 if (custom->innerp->isa != (void *)NULL) {
29 printf("not a NULL __block isa\n");
30 exit(1);
32 return;
35 int main(int argc, char *argv[]) {
37 __block int i;
39 check(^{ printf("%d\n", ++i); });
40 printf("%s: success\n", argv[0]);
41 return 0;