blob: 4565553338ac2a214475dc3892567f70f215fcd3 [file] [log] [blame]
Blaine Garst86d0ba42010-08-04 23:34:21 +00001//
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//
8// byrefaccess.m
9// test that byref access to locals is accurate
10// testObjects
11//
12// Created by Blaine Garst on 5/13/08.
13//
14// CONFIG
15
16#include <stdio.h>
17
18
19void callVoidVoid(void (^closure)(void)) {
20 closure();
21}
22
23int main(int argc, char *argv[]) {
24 __block int i = 10;
25
26 callVoidVoid(^{ ++i; });
27
28 if (i != 11) {
29 printf("*** %s didn't update i\n", argv[0]);
30 return 1;
31 }
32 printf("%s: success\n", argv[0]);
33 return 0;
34}