brintos

brintos / llvm-project-archived public Read only

0
0
Text · 693 B · 9eebe7a Raw
29 lines · c
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-exception5 6// CONFIG open rdar://64396007 8#import <stdio.h>9#import <stdlib.h>10 11#define NUMBER_OF_BLOCKS 10012int main (int argc, const char * argv[]) {13    int (^x[NUMBER_OF_BLOCKS])();14    int i;15    16    for(i=0; i<NUMBER_OF_BLOCKS; i++) x[i] = ^{ return i; };17 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);22        }23    }24    25    printf("%s: success\n", argv[0]);26    27    return 0;28}29