brintos

brintos / llvm-project-archived public Read only

0
0
Text · 678 B · b03c6a8 Raw
34 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//7//  byrefaccess.m8//  test that byref access to locals is accurate9//  testObjects10//11//  Created by Blaine Garst on 5/13/08.12//13// CONFIG14 15#include <stdio.h>16 17 18void callVoidVoid(void (^closure)(void)) {19    closure();20}21 22int main(int argc, char *argv[]) {23    __block int i = 10;24    25    callVoidVoid(^{ ++i; });26    27    if (i != 11) {28        printf("*** %s didn't update i\n", argv[0]);29        return 1;30    }31    printf("%s: success\n", argv[0]);32    return 0;33}34