[cfe-commits] r70984 - /cfe/trunk/test/Analysis/retain-release.m
Ted Kremenek
kremenek at apple.com
Tue May 5 10:46:43 PDT 2009
Author: kremenek
Date: Tue May 5 12:46:22 2009
New Revision: 70984
URL: http://llvm.org/viewvc/llvm-project?rev=70984&view=rev
Log:
Enhance ownership attribute tests with functions that use the attributes!
Modified:
cfe/trunk/test/Analysis/retain-release.m
Modified: cfe/trunk/test/Analysis/retain-release.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/retain-release.m?rev=70984&r1=70983&r2=70984&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/retain-release.m (original)
+++ cfe/trunk/test/Analysis/retain-release.m Tue May 5 12:46:22 2009
@@ -463,6 +463,22 @@
NSString *str = [X returnsAnOwnedCFString]; // expected-warning{{leak}}
}
+__attribute__((ns_returns_owned))
+NSString* test_attr_1c(TestOwnershipAttr *X) {
+ NSString *str = [X returnsAnOwnedString]; // no-warning
+ return str;
+}
+
+void test_attr_1d_helper(NSString* str __attribute__((ns_retains)));
+
+__attribute__((ns_returns_owned))
+NSString* test_attr_1d(TestOwnershipAttr *X) {
+ NSString *str = [X returnsAnOwnedString]; // expected-warning{{leak}}
+ test_attr_1d_helper(str);
+ return str;
+}
+
+
void test_attr_2(TestOwnershipAttr *X) {
NSString *str = [X returnsAnOwnedString]; // expected-warning{{leak}}
[X myRetain:str];
More information about the cfe-commits
mailing list