1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -fobjc-arc -x objective-c %s.result
2 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s > %t
3 // RUN: diff %t %s.result
7 @interface A : NSObject {
13 @interface B : NSObject {
15 xpc_object_t _xpc_prop;
17 - (BOOL)containsSelf:(A*)a;
18 @property (retain) id prop;
19 @property (retain) xpc_object_t xpc_prop;
26 - (BOOL)containsSelf:(A*)a {
27 return a->object == self;
33 -(void) setProp:(id) newVal {
35 _prop = [newVal retain];
37 -(void) setProp2:(CFTypeRef) newVal {
39 _prop = (id)CFRetain(newVal);
45 -(void) setXpc_prop:(xpc_object_t) newVal {
46 [_xpc_prop autorelease];
47 _xpc_prop = xpc_retain(newVal);
53 int main (int argc, const char * argv[]) {
54 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
55 A *a = [[A new] autorelease];
56 B *b = [[B new] autorelease];
57 NSLog(@"%s", [b containsSelf:a] ? "YES" : "NO");
62 void test(A *prevVal, A *newVal) {
63 [prevVal autorelease];
64 prevVal = [newVal retain];
68 [[val retain] autorelease];
73 id a = [[A alloc] init];