tsan: fix deadlock detector lit test output
[blocksruntime.git] / test / BlocksRuntime / byrefcopyinner.c
blob07770933afe368cfdf4d9f8a7071948ea251a5da
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 <Block.h>
8 #include <stdio.h>
10 // CONFIG rdar://6225809
11 // fixed in 5623
13 int main(int argc, char *argv[]) {
14 __block int a = 42;
15 int* ap = &a; // just to keep the address on the stack.
17 void (^b)(void) = ^{
18 //a; // workaround, a should be implicitly imported
19 Block_copy(^{
20 a = 2;
21 });
24 Block_copy(b);
26 if(&a == ap) {
27 printf("**** __block heap storage should have been created at this point\n");
28 return 1;
30 printf("%s: Success\n", argv[0]);
31 return 0;