Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / BlocksRuntime / rdar6414583.c
blob671179aa5896a9cd0950e428cce073c5a5cdda42
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 // CONFIG rdar://6414583
8 // a smaller case of byrefcopyint
10 #include <Block.h>
11 #include <dispatch/dispatch.h>
12 #include <stdio.h>
14 int main(int argc, char *argv[]) {
15 __block int c = 1;
17 //printf("&c = %p - c = %i\n", &c, c);
19 int i;
20 for(i =0; i < 2; i++) {
21 dispatch_block_t block = Block_copy(^{ c = i; });
23 block();
24 // printf("%i: &c = %p - c = %i\n", i, &c, c);
26 Block_release(block);
28 printf("%s: success\n", argv[0]);
29 return 0;