[Sanitizer] Add rudimentary support for wide-character strings to scanf/printf interc...
[blocksruntime.git] / test / BlocksRuntime / byrefcopystack.c
blobd119afa3668f03464f963c453998b503eaf4392f
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.
7 //
8 // byrefcopystack.m
9 // testObjects
11 // Created by Blaine Garst on 5/13/08.
16 #include <stdio.h>
17 #include <Block.h>
19 // CONFIG rdar://6255170
21 void (^bumpi)(void);
22 int (^geti)(void);
24 void setClosures() {
25 int __block i = 10;
26 bumpi = Block_copy(^{ ++i; });
27 geti = Block_copy(^{ return i; });
30 int main(int argc, char *argv[]) {
31 setClosures();
32 bumpi();
33 int i = geti();
35 if (i != 11) {
36 printf("*** %s didn't update i\n", argv[0]);
37 return 1;
39 printf("%s: success\n", argv[0]);
40 return 0;