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 // testfilerunner CONFIG
14 void (^gblock
)(int) = ^(int x
){ global
= x
; };
16 int main(int argc
, char *argv
[]) {
19 printf("%s: *** did not set global to 1\n", argv
[0]);
22 void (^gblockcopy
)(int) = Block_copy(gblock
);
23 if (gblockcopy
!= gblock
) {
24 printf("global copy %p not a no-op %p\n", (void *)gblockcopy
, (void *)gblock
);
27 Block_release(gblockcopy
);
30 printf("%s: *** did not set global to 3\n", argv
[0]);
33 gblockcopy
= Block_copy(gblock
);
36 printf("%s: *** did not set global to 5\n", argv
[0]);
39 printf("%s: Success!\n", argv
[0]);