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 10/13/08.
16 // pure C nothing more needed
17 // CONFIG rdar://6289344
21 #include <Block_private.h>
26 int main(int argc
, char *argv
[]) {
28 int (^intblock
)(void) = ^{ return i
*10; };
32 printf("intblock returns %d\n", intblock());
37 //printf("Block dump %s\n", _Block_dump(vv));
39 struct Block_layout
*layout
= (struct Block_layout
*)(void *)vv
;
40 printf("isa %p\n", layout
->isa
);
41 printf("flags %x\n", layout
->flags
);
42 printf("descriptor %p\n", layout
->descriptor
);
43 printf("descriptor->size %d\n", layout
->descriptor
->size
);
46 void (^vvcopy
)(void) = Block_copy(vv
);
47 Block_release(vvcopy
);
48 printf("%s: success\n", argv
[0]);