2 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
3 // See https://llvm.org/LICENSE.txt for license information.
4 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 // testfilerunner CONFIG
13 void (^gblock
)(int) = ^(int x
){ global
= x
; };
15 int main(int argc
, char *argv
[]) {
18 printf("%s: *** did not set global to 1\n", argv
[0]);
21 void (^gblockcopy
)(int) = Block_copy(gblock
);
22 if (gblockcopy
!= gblock
) {
23 printf("global copy %p not a no-op %p\n", (void *)gblockcopy
, (void *)gblock
);
26 Block_release(gblockcopy
);
29 printf("%s: *** did not set global to 3\n", argv
[0]);
32 gblockcopy
= Block_copy(gblock
);
35 printf("%s: *** did not set global to 5\n", argv
[0]);
38 printf("%s: Success!\n", argv
[0]);