| 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 |
| 4 | |
| 5 | #include "Common.h" |
| 6 | |
| 7 | @interface A : NSObject { |
| 8 | @package |
| 9 | id object; |
| 10 | } |
| 11 | @end |
| 12 | |
| 13 | @interface B : NSObject { |
| 14 | id _prop; |
| 15 | xpc_object_t _xpc_prop; |
| 16 | } |
| 17 | - (BOOL)containsSelf:(A*)a; |
| 18 | @property (strong) id prop; |
| 19 | @property (strong) xpc_object_t xpc_prop; |
| 20 | @end |
| 21 | |
| 22 | @implementation A |
| 23 | @end |
| 24 | |
| 25 | @implementation B |
| 26 | - (BOOL)containsSelf:(A*)a { |
| 27 | return a->object == self; |
| 28 | } |
| 29 | |
| 30 | -(id) prop { |
| 31 | return _prop; |
| 32 | } |
| 33 | -(void) setProp:(id) newVal { |
| 34 | _prop = newVal; |
| 35 | } |
| 36 | -(void) setProp2:(CFTypeRef) newVal { |
| 37 | _prop = (id)CFBridgingRelease(CFRetain(newVal)); |
| 38 | } |
| 39 | |
| 40 | -(id) xpc_prop { |
| 41 | return _xpc_prop; |
| 42 | } |
| 43 | -(void) setXpc_prop:(xpc_object_t) newVal { |
| 44 | _xpc_prop = newVal; |
| 45 | } |
| 46 | @end |
| 47 | |
| 48 | void NSLog(id, ...); |
| 49 | |
| 50 | int main (int argc, const char * argv[]) { |
| 51 | @autoreleasepool { |
| 52 | A *a = [A new]; |
| 53 | B *b = [B new]; |
| 54 | NSLog(@"%s", [b containsSelf:a] ? "YES" : "NO"); |
| 55 | } |
| 56 | return 0; |
| 57 | } |
| 58 | |
| 59 | void test(A *prevVal, A *newVal) { |
| 60 | prevVal = newVal; |
| 61 | } |
| 62 | |
| 63 | id test2(A* val) { |
| 64 | return val; |
| 65 | } |
| 66 | |
| 67 | id test3() { |
| 68 | id a = [[A alloc] init]; |
| 69 | } |
| 70 | |