blob: 4176ec580c3e5813738ffe27cc3c4366d1f1f107 [file] [log] [blame]
John McCall9b0a7ce2011-10-02 01:16:38 +00001// 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 McCalld70fb982011-06-15 23:25:17 +00003// RUN: diff %t %s.result
4
5@interface Foo
6@property (retain) id x;
7@property (retain) id y;
8@property (retain) id w;
9@property (retain) id z;
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.x = self.y = self.w = 0;
22 self.x = 0, w = 0, y = 0;
23 [self setY:0];
24 w = 0;
25 q = 0;
26 self.z = 0;
27}
28@end
29
30@interface Bar
31@property (retain) Foo *a;
32- (void) setA:(Foo*) val;
33- (id) a;
34@end
35
36@implementation Bar
37- (void) dealloc {
38 [self setA:0]; // This is user-defined setter overriding synthesize, don't touch it.
39 self.a.x = 0; // every dealloc must zero out its own ivar. This patter is not recognized.
40}
Fariborz Jahaniane1506cb2011-08-01 22:39:49 +000041@synthesize a;
John McCalld70fb982011-06-15 23:25:17 +000042- (void) setA:(Foo*) val { }
43- (id) a {return 0;}
44@end