1 // RUN: %clang_cc1 -fblocks -fsyntax-only -fobjc-arc -x objective-c %s.result 2 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fblocks -fsyntax-only -x objective-c %s > %t 3 // RUN: diff %t %s.result 4 5 #include "Common.h" 6 7 #define dispatch_retain(object) ({ dispatch_object_t _o = (object); _dispatch_object_validate(_o); (void)[_o retain]; }) 8 #define dispatch_release(object) ({ dispatch_object_t _o = (object); _dispatch_object_validate(_o); [_o release]; }) 9 #define xpc_retain(object) ({ xpc_object_t _o = (object); _xpc_object_validate(_o); [_o retain]; }) 10 #define xpc_release(object) ({ xpc_object_t _o = (object); _xpc_object_validate(_o); [_o release]; }) 11 12 typedef id dispatch_object_t; 13 typedef id xpc_object_t; 14 15 void _dispatch_object_validate(dispatch_object_t object); 16 void _xpc_object_validate(xpc_object_t object); 17 18 dispatch_object_t getme(void); 19 20 void func(dispatch_object_t o) { 21 dispatch_retain(o); 22 dispatch_release(o); 23 dispatch_retain(getme()); 24 } 25 26 void func2(xpc_object_t o) { 27 xpc_retain(o); 28 xpc_release(o); 29 } 30