[Sanitizer] Add rudimentary support for wide-character strings to scanf/printf interc...
[blocksruntime.git] / test / BlocksRuntime / localisglobal.c
blob75a79dff48ee97e0a725db782dbadc4980c8617b
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 * localisglobal.c
9 * testObjects
11 * Created by Blaine Garst on 9/29/08.
13 * works in all configurations
14 * CONFIG rdar://6230297
17 #include <stdio.h>
19 void (^global)(void) = ^{ printf("hello world\n"); };
21 int aresame(void *first, void *second) {
22 long *f = (long *)first;
23 long *s = (long *)second;
24 return *f == *s;
26 int main(int argc, char *argv[]) {
27 int i = 10;
28 void (^local)(void) = ^ { printf("hi %d\n", i); };
29 void (^localisglobal)(void) = ^ { printf("hi\n"); };
31 if (aresame(local, localisglobal)) {
32 printf("local block could be global, but isn't\n");
33 return 1;
35 if (!aresame(global, localisglobal)) {
36 printf("local block is not global, not stack, what is it??\n");
37 return 1;
39 printf("%s: success\n", argv[0]);
40 return 0;