| // RUN: %clang_cc1 -analyze -analyzer-checker=alpha.core -analyzer-checker=alpha.osx.cocoa.Dealloc %s -verify |
| // Tests for the checker which checks missing/extra ivar 'release' calls |
| @interface MyClass : NSObject { |
| @property(readonly) id N; |
| @synthesize Y = _Y; // expected-warning{{The '_Y' instance variable was retained by a synthesized property but wasn't released in 'dealloc'}} |
| @synthesize Z = _Z; // expected-warning{{The '_Z' instance variable was not retained by a synthesized property but was released in 'dealloc'}} |
| @synthesize W = _W; // expected-warning{{The '_W' instance variable was retained by a synthesized property but wasn't released in 'dealloc'}} |
| self.M = 0; // This will release '_M' |
| [self setV:0]; // This will release '_V' |
| [self setW:@"newW"]; // This will release '_W', but retain the new value |
| self.O = 0; // no-warning |