1/* 2 * Copyright (c) 2010 Apple Inc. All rights reserved. 3 * 4 * @APPLE_LLVM_LICENSE_HEADER@ 5 */ 6 7// TEST_CONFIG rdar://6414583 8 9// a smaller case of byrefcopyint 10 11#include <Block.h> 12#include <dispatch/dispatch.h> 13#include <stdio.h> 14#include "test.h" 15 16int main() { 17 __block int c = 1; 18 19 //printf("&c = %p - c = %i\n", &c, c); 20 21 int i; 22 for(i =0; i < 2; i++) { 23 dispatch_block_t block = Block_copy(^{ c = i; }); 24 25 block(); 26// printf("%i: &c = %p - c = %i\n", i, &c, c); 27 28 Block_release(block); 29 } 30 31 succeed(__FILE__); 32} 33