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
10 * Created by Blaine Garst on 9/29/08.
12 * works in all configurations
13 * CONFIG rdar://6230297
18 void (^global
)(void) = ^{ printf("hello world\n"); };
20 int aresame(void *first
, void *second
) {
21 long *f
= (long *)first
;
22 long *s
= (long *)second
;
25 int main(int argc
, char *argv
[]) {
27 void (^local
)(void) = ^ { printf("hi %d\n", i
); };
28 void (^localisglobal
)(void) = ^ { printf("hi\n"); };
30 if (aresame(local
, localisglobal
)) {
31 printf("local block could be global, but isn't\n");
34 if (!aresame(global
, localisglobal
)) {
35 printf("local block is not global, not stack, what is it??\n");
38 printf("%s: success\n", argv
[0]);