1//
2//                     The LLVM Compiler Infrastructure
3//
4// This file is distributed under the University of Illinois Open Source
5// License. See LICENSE.TXT for details.
6
7// CONFIG open rdar://6439600
8
9#import <stdio.h>
10#import <stdlib.h>
11
12#define NUMBER_OF_BLOCKS 100
13int main (int argc, const char * argv[]) {
14    int (^x[NUMBER_OF_BLOCKS])();
15    int i;
16
17    for(i=0; i<NUMBER_OF_BLOCKS; i++) x[i] = ^{ return i; };
18
19    for(i=0; i<NUMBER_OF_BLOCKS; i++) {
20        if (x[i]() != i) {
21            printf("%s: failure, %d != %d\n", argv[0], x[i](), i);
22            exit(1);
23        }
24    }
25
26    printf("%s: success\n", argv[0]);
27
28    return 0;
29}
30