John McCall | 8f0e8d2 | 2011-06-15 23:25:17 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -x objective-c %s.result |
Argyrios Kyrtzidis | eaed19e | 2011-06-16 00:53:46 +0000 | [diff] [blame^] | 2 | // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -x objective-c %s > %t |
John McCall | 8f0e8d2 | 2011-06-15 23:25:17 +0000 | [diff] [blame] | 3 | // RUN: diff %t %s.result |
| 4 | |
| 5 | #include "Common.h" |
| 6 | |
| 7 | @interface Foo : NSObject <NSCopying, NSMutableCopying> { |
| 8 | id bar; |
| 9 | } |
| 10 | @property (retain) id bar; |
| 11 | -(id)test:(NSZone *)z; |
| 12 | @end |
| 13 | |
| 14 | @implementation Foo |
| 15 | |
| 16 | @synthesize bar; |
| 17 | |
| 18 | +(id)class_test:(NSZone *)z { |
| 19 | return [self alloc]; |
| 20 | } |
| 21 | |
| 22 | -(id)test:(NSZone *)z { |
| 23 | |
| 24 | Foo *foo1 = [[Foo alloc] init]; |
| 25 | Foo *foo2 = [[Foo alloc] init]; |
| 26 | Foo *foo3 = [[Foo alloc] init]; |
| 27 | |
| 28 | Foo *foo4 = [[Foo alloc] init]; |
| 29 | Foo *foo5 = [[Foo alloc] init]; |
| 30 | Foo *foo6 = [[Foo alloc] init]; |
| 31 | |
| 32 | foo1 = [foo1 copy]; |
| 33 | foo2 = [foo1 copy]; |
| 34 | foo3 = [foo1 copy]; |
| 35 | foo1 = [foo1 mutableCopy]; |
| 36 | |
| 37 | return foo1; |
| 38 | } |
| 39 | |
| 40 | @end |