summaryrefslogtreecommitdiffstats
path: root/test/Analysis/inlining/RetainCountExamples.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/inlining/RetainCountExamples.m')
-rw-r--r--test/Analysis/inlining/RetainCountExamples.m33
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 0000000..2b682c2
--- /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
OpenPOWER on IntegriCloud