summaryrefslogtreecommitdiff
path: root/test/Analysis/retain-release-inline.m
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2012-12-02 13:20:44 +0000
committerDimitry Andric <dim@FreeBSD.org>2012-12-02 13:20:44 +0000
commit13cc256e404620c1de0cbcc4e43ce1e2dbbc4898 (patch)
tree2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /test/Analysis/retain-release-inline.m
parent657bc3d9848e3be92029b2416031340988cd0111 (diff)
downloadsrc-test2-13cc256e404620c1de0cbcc4e43ce1e2dbbc4898.tar.gz
src-test2-13cc256e404620c1de0cbcc4e43ce1e2dbbc4898.zip
Notes
Diffstat (limited to 'test/Analysis/retain-release-inline.m')
-rw-r--r--test/Analysis/retain-release-inline.m18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/Analysis/retain-release-inline.m b/test/Analysis/retain-release-inline.m
index 610df7f7e94a..6ff9e9a55264 100644
--- a/test/Analysis/retain-release-inline.m
+++ b/test/Analysis/retain-release-inline.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -analyzer-store=region -fblocks -analyzer-ipa=inlining -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,osx.coreFoundation.CFRetainRelease,osx.cocoa.ClassRelease,osx.cocoa.RetainCount -fblocks -verify %s
//===----------------------------------------------------------------------===//
// The following code is reduced using delta-debugging from Mac OS X headers:
@@ -343,5 +343,21 @@ void test_test_return_inline_2(char *bytes) {
CFRelease(str);
}
+extern CFStringRef getString(void);
+CFStringRef testCovariantReturnType(void) __attribute__((cf_returns_retained));
+void usetestCovariantReturnType() {
+ CFStringRef S = ((void*)0);
+ S = testCovariantReturnType();
+ if (S)
+ CFRelease(S);
+}
+CFStringRef testCovariantReturnType() {
+ CFStringRef Str = ((void*)0);
+ Str = getString();
+ if (Str) {
+ CFRetain(Str);
+ }
+ return Str;
+}