// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx -verify %s
typedefsignedcharBOOL;@protocolNSObject-(BOOL)isEqual:(id)object; @end
@interfaceNSObject<NSObject>{}+(id)alloc;+(id)new;-(id)init;-(id)autorelease;-(id)copy;- (Class)class;-(id)retain;- (onewayvoid)release;@end@interfaceCell:NSObject{int x;}- (id)init;- (void)test;@end@implementationCell- (id)init{if((self=[superinit])){returnself;}// Test that this is being analyzed.
int m;
m = m +1;//expected-warning {{The left operand of '+' is a garbage value}}
returnself;}// Make sure that we do not propagate the 'nil' check from inlined 'init' to 'test'.
- (void)test{
Cell *newCell =[[Cell alloc] init];
newCell->x =5;// no-warning
[newCell release];}@end