[AA] Rename CaptureInfo -> CaptureAnalysis (NFC) (#116842)
[llvm-project.git] / compiler-rt / test / BlocksRuntime / byrefaccess.c
blobb03c6a8b542c514718b3dc86a38b2621594bf016
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 //
7 // byrefaccess.m
8 // test that byref access to locals is accurate
9 // testObjects
11 // Created by Blaine Garst on 5/13/08.
13 // CONFIG
15 #include <stdio.h>
18 void callVoidVoid(void (^closure)(void)) {
19 closure();
22 int main(int argc, char *argv[]) {
23 __block int i = 10;
25 callVoidVoid(^{ ++i; });
27 if (i != 11) {
28 printf("*** %s didn't update i\n", argv[0]);
29 return 1;
31 printf("%s: success\n", argv[0]);
32 return 0;