Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / BlocksRuntime / copy-block-literal-rdar6439600.c
blob9eebe7aa0bc342bbb9b3f808b6bff20beca98e42
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 open rdar://6439600
8 #import <stdio.h>
9 #import <stdlib.h>
11 #define NUMBER_OF_BLOCKS 100
12 int main (int argc, const char * argv[]) {
13 int (^x[NUMBER_OF_BLOCKS])();
14 int i;
16 for(i=0; i<NUMBER_OF_BLOCKS; i++) x[i] = ^{ return i; };
18 for(i=0; i<NUMBER_OF_BLOCKS; i++) {
19 if (x[i]() != i) {
20 printf("%s: failure, %d != %d\n", argv[0], x[i](), i);
21 exit(1);
25 printf("%s: success\n", argv[0]);
27 return 0;