Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / BlocksRuntime / rdar6405500.c
blob03fb43c6bb9eefd4b5862deff00dd8131a4c9969
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://6405500
8 #include <stdio.h>
9 #include <stdlib.h>
10 #import <dispatch/dispatch.h>
11 #import <objc/objc-auto.h>
13 int main (int argc, const char * argv[]) {
14 __block void (^blockFu)(size_t t);
15 blockFu = ^(size_t t){
16 if (t == 20) {
17 printf("%s: success\n", argv[0]);
18 exit(0);
19 } else
20 dispatch_async(dispatch_get_main_queue(), ^{ blockFu(20); });
23 dispatch_apply(10, dispatch_get_concurrent_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT), blockFu);
25 dispatch_main();
26 printf("shouldn't get here\n");
27 return 1;