2 // The LLVM Compiler Infrastructure
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
7 // CONFIG rdar://6255170
13 #include <Block_private.h>
18 main(int argc
, char *argv
[])
22 void (^b
)(void) = ^{ var
++; /*printf("var is at %p with value %d\n", &var, var);*/ };
24 //printf("before copy...\n");
28 for (i
= 0; i
< 10; i
++) {
29 _b
= Block_copy(b
); // make a new copy each time
32 _b(); // should still update the stack
36 //printf("after...\n");
39 if (var
!= shouldbe
) {
40 printf("Hmm, var is %d but should be %d\n", var
, shouldbe
);
43 printf("%s: Success!!\n", argv
[0]);