1/* 2 * Copyright (c) 2010 Apple Inc. All rights reserved. 3 * 4 * @APPLE_LLVM_LICENSE_HEADER@ 5 */ 6 7#import "common.h" 8 9int useCounter = 0; 10void lastUse(int param) { 11 ++useCounter; 12} 13 14int bcounter = 0; 15#if FARIBORZ 16void _Block_byref_release(void *byrefblock) { 17 ++bcounter; 18} 19#endif 20 21int main(int argc, char *argv[]) { 22 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 23 24 test(); 25 if (bcounter != useCounter) { 26 printf("%s: byref block not released %d times: %d\n", argv[0], useCounter, bcounter); 27 return 1; 28 } 29 printf("%s: ok\n", argv[0]); 30 [pool drain]; 31 return 0; 32} 33