Anna Zaks | c739406 | 2012-08-14 00:36:20 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-ipa=dynamic-bifurcate -verify %s |
| 2 | |
| 3 | typedef signed char BOOL; |
| 4 | typedef struct objc_class *Class; |
| 5 | typedef struct objc_object { |
| 6 | Class isa; |
| 7 | } *id; |
| 8 | @protocol NSObject - (BOOL)isEqual:(id)object; @end |
| 9 | @interface NSObject <NSObject> {} |
| 10 | +(id)alloc; |
| 11 | +(id)new; |
| 12 | - (oneway void)release; |
| 13 | -(id)init; |
| 14 | -(id)autorelease; |
| 15 | -(id)copy; |
| 16 | - (Class)class; |
| 17 | -(id)retain; |
| 18 | @end |
| 19 | |
| 20 | @interface SelfStaysLive : NSObject |
| 21 | - (id)init; |
| 22 | @end |
| 23 | |
| 24 | @implementation SelfStaysLive |
| 25 | - (id)init { |
| 26 | return [super init]; |
| 27 | } |
| 28 | @end |
| 29 | |
| 30 | void selfStaysLive() { |
| 31 | SelfStaysLive *foo = [[SelfStaysLive alloc] init]; |
| 32 | [foo release]; |
| 33 | } |