1// TEST_CONFIG MEM=gc 2// TEST_CFLAGS -framework Foundation 3 4// This test must use CF and test ignoredSelector must not use CF. 5 6#include "test.h" 7#include <objc/NSObject.h> 8 9int main() 10{ 11 if (objc_collectingEnabled()) { 12 // ARC RR functions don't retain and don't hit the side table. 13 __block int count; 14 testblock_t testblock = ^{ 15 for (int i = 0; i < count; i++) { 16 id obj = [NSObject new]; 17 objc_retain(obj); 18 objc_retain(obj); 19 objc_release(obj); 20 } 21 }; 22 count = 100; 23 testonthread(testblock); 24 testonthread(testblock); 25 leak_mark(); 26 count = 10000000; 27 testonthread(testblock); 28 leak_check(0); 29 } 30 31 succeed(__FILE__); 32} 33