diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
| commit | 56d91b49b13fe55c918afbda19f6165b5fbff87a (patch) | |
| tree | 9abb1a658a297776086f4e0dfa6ca533de02104e /test/Analysis/inlining/RetainCountExamples.m | |
| parent | 41e20f564abdb05101d6b2b29c59459a966c22cc (diff) | |
Notes
Diffstat (limited to 'test/Analysis/inlining/RetainCountExamples.m')
| -rw-r--r-- | test/Analysis/inlining/RetainCountExamples.m | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/Analysis/inlining/RetainCountExamples.m b/test/Analysis/inlining/RetainCountExamples.m new file mode 100644 index 000000000000..2b682c2b4bf0 --- /dev/null +++ b/test/Analysis/inlining/RetainCountExamples.m @@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-ipa=dynamic-bifurcate -verify %s + +typedef signed char BOOL; +typedef struct objc_class *Class; +typedef struct objc_object { + Class isa; +} *id; +@protocol NSObject - (BOOL)isEqual:(id)object; @end +@interface NSObject <NSObject> {} ++(id)alloc; ++(id)new; +- (oneway void)release; +-(id)init; +-(id)autorelease; +-(id)copy; +- (Class)class; +-(id)retain; +@end + +@interface SelfStaysLive : NSObject +- (id)init; +@end + +@implementation SelfStaysLive +- (id)init { + return [super init]; +} +@end + +void selfStaysLive() { + SelfStaysLive *foo = [[SelfStaysLive alloc] init]; + [foo release]; +}
\ No newline at end of file |
