5 #if __OBJC_GC__ && __cplusplus && __i386__
9 testwarn("rdar://19042235 test disabled for 32-bit objc++ GC because of unknown bit rot");
18 #include <objc/objc-runtime.h>
20 @interface Weak : TestRoot {
31 void *fn(void *arg __unused)
33 objc_registerThreadWithCollector();
44 value = [TestRoot new];
46 oldObject = [Weak new];
47 testassert(oldObject);
49 oldObject->value = value;
50 testassert(oldObject->value == value);
52 newObject = [oldObject copy];
53 testassert(newObject);
54 testassert(newObject->value == oldObject->value);
56 newObject->value = nil;
57 testassert(newObject->value == nil);
58 testassert(oldObject->value == value);
68 testassert(TestRootDealloc || TestRootFinalize);
70 #if defined(__OBJC_GC__) || __has_feature(objc_arc)
71 testassert(oldObject->value == nil);
73 testassert(oldObject->value != nil);
75 testassert(newObject->value == nil);
77 RELEASE_VAR(newObject);
78 RELEASE_VAR(oldObject);