John McCall | 9b0a7ce | 2011-10-02 01:16:38 +0000 | [diff] [blame] | 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 |
John McCall | d70fb98 | 2011-06-15 23:25:17 +0000 | [diff] [blame] | 3 | // RUN: diff %t %s.result |
| 4 | |
| 5 | @interface Foo |
Fariborz Jahanian | 9652adf | 2012-01-20 19:15:02 +0000 | [diff] [blame] | 6 | @property (strong) id x; |
| 7 | @property (strong) id y; |
| 8 | @property (strong) id w; |
| 9 | @property (strong) id z; |
John McCall | d70fb98 | 2011-06-15 23:25:17 +0000 | [diff] [blame] | 10 | @property (strong) id q; |
| 11 | @end |
| 12 | |
| 13 | @implementation Foo |
| 14 | @synthesize x; |
| 15 | @synthesize y; |
| 16 | @synthesize w; |
| 17 | @synthesize q; |
| 18 | @dynamic z; |
| 19 | |
| 20 | - (void) dealloc { |
| 21 | self.z = 0; |
| 22 | } |
| 23 | @end |
| 24 | |
| 25 | @interface Bar |
Fariborz Jahanian | 9652adf | 2012-01-20 19:15:02 +0000 | [diff] [blame] | 26 | @property (strong) Foo *a; |
John McCall | d70fb98 | 2011-06-15 23:25:17 +0000 | [diff] [blame] | 27 | - (void) setA:(Foo*) val; |
| 28 | - (id) a; |
| 29 | @end |
| 30 | |
| 31 | @implementation Bar |
| 32 | - (void) dealloc { |
| 33 | [self setA:0]; // This is user-defined setter overriding synthesize, don't touch it. |
| 34 | self.a.x = 0; // every dealloc must zero out its own ivar. This patter is not recognized. |
| 35 | } |
Fariborz Jahanian | e1506cb | 2011-08-01 22:39:49 +0000 | [diff] [blame] | 36 | @synthesize a; |
John McCall | d70fb98 | 2011-06-15 23:25:17 +0000 | [diff] [blame] | 37 | - (void) setA:(Foo*) val { } |
| 38 | - (id) a {return 0;} |
| 39 | @end |