1*67e74705SXin Li// RUN: %clang_cc1 -triple x86_64-apple-macosx10.6 -fsyntax-only -fobjc-runtime-has-weak -fobjc-arc -x objective-c %s.result 2*67e74705SXin Li// RUN: arcmt-test --args -triple x86_64-apple-macosx10.6 -fsyntax-only -fobjc-gc-only -x objective-c %s > %t 3*67e74705SXin Li// RUN: diff %t %s.result 4*67e74705SXin Li// RUN: arcmt-test --args -triple x86_64-apple-macosx10.6 -fsyntax-only -fobjc-gc-only -x objective-c++ %s > %t 5*67e74705SXin Li// RUN: diff %t %s.result 6*67e74705SXin Li 7*67e74705SXin Li#include "Common.h" 8*67e74705SXin Li#include "GC.h" 9*67e74705SXin Li 10*67e74705SXin Livoid test1(CFTypeRef *cft) { 11*67e74705SXin Li id x = CFBridgingRelease(cft); 12*67e74705SXin Li} 13*67e74705SXin Li 14*67e74705SXin Li@interface I1 15*67e74705SXin Li@end 16*67e74705SXin Li 17*67e74705SXin Li@implementation I1 18*67e74705SXin Li-(void)dealloc { 19*67e74705SXin Li // dealloc 20*67e74705SXin Li test1(0); 21*67e74705SXin Li} 22*67e74705SXin Li 23*67e74705SXin Li@end 24*67e74705SXin Li 25*67e74705SXin Li@interface I2 26*67e74705SXin Li@property (strong) id prop; 27*67e74705SXin Li@end 28*67e74705SXin Li 29*67e74705SXin Li@implementation I2 30*67e74705SXin Li@synthesize prop; 31*67e74705SXin Li 32*67e74705SXin Li-(void)dealloc { 33*67e74705SXin Li // finalize 34*67e74705SXin Li test1(0); 35*67e74705SXin Li} 36*67e74705SXin Li@end 37*67e74705SXin Li 38*67e74705SXin Li__attribute__((objc_arc_weak_reference_unavailable)) 39*67e74705SXin Li@interface QQ { 40*67e74705SXin Li __unsafe_unretained id s; 41*67e74705SXin Li __unsafe_unretained QQ *q; 42*67e74705SXin Li} 43*67e74705SXin Li@end 44*67e74705SXin Li 45*67e74705SXin Li@interface I3 46*67e74705SXin Li@property (unsafe_unretained) I3 * pw1, * pw2; 47*67e74705SXin Li@property (strong) I3 * ps; 48*67e74705SXin Li@property (assign) I3 * pds; 49*67e74705SXin Li@end 50*67e74705SXin Li 51*67e74705SXin Li@interface I4Impl { 52*67e74705SXin Li I4Impl *__strong pds2; 53*67e74705SXin Li} 54*67e74705SXin Li@property (unsafe_unretained) I4Impl * pw1, * pw2; 55*67e74705SXin Li@property (strong) I4Impl * ps; 56*67e74705SXin Li@property (strong) I4Impl * pds; 57*67e74705SXin Li@property (strong) I4Impl * pds2; 58*67e74705SXin Li@end 59*67e74705SXin Li 60*67e74705SXin Li@implementation I4Impl 61*67e74705SXin Li@synthesize pw1, pw2, ps, pds, pds2; 62*67e74705SXin Li 63*67e74705SXin Li-(void)test1:(CFTypeRef *)cft { 64*67e74705SXin Li id x = CFBridgingRelease(cft); 65*67e74705SXin Li} 66*67e74705SXin Li@end 67*67e74705SXin Li 68*67e74705SXin Li@interface I5 { 69*67e74705SXin Li __unsafe_unretained id prop; 70*67e74705SXin Li} 71*67e74705SXin Li@property (unsafe_unretained, readonly) id prop; 72*67e74705SXin Li@end 73