Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / BlocksRuntime / nullblockisa.c
blob5bf7240cb5ec773e6b74681787159a8657098504
1 //
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 //
7 // nullblockisa.m
8 // testObjects
9 //
10 // Created by Blaine Garst on 9/24/08.
12 // CONFIG rdar://6244520
16 #include <stdio.h>
17 #include <stdlib.h>
18 #include <Block_private.h>
21 void check(void (^b)(void)) {
22 struct _custom {
23 struct Block_layout layout;
24 struct Block_byref *innerp;
25 } *custom = (struct _custom *)(void *)(b);
26 //printf("block is at %p, size is %lx, inner is %p\n", (void *)b, Block_size(b), innerp);
27 if (custom->innerp->isa != (void *)NULL) {
28 printf("not a NULL __block isa\n");
29 exit(1);
31 return;
34 int main(int argc, char *argv[]) {
36 __block int i;
38 check(^{ printf("%d\n", ++i); });
39 printf("%s: success\n", argv[0]);
40 return 0;