[cfe-commits] r51454 - /cfe/trunk/test/Analysis-Apple/NSString.m
Ted Kremenek
kremenek at apple.com
Thu May 22 16:46:11 PDT 2008
Author: kremenek
Date: Thu May 22 18:46:11 2008
New Revision: 51454
URL: http://llvm.org/viewvc/llvm-project?rev=51454&view=rev
Log:
Additional retain/release checker regression tests.
Modified:
cfe/trunk/test/Analysis-Apple/NSString.m
Modified: cfe/trunk/test/Analysis-Apple/NSString.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis-Apple/NSString.m?rev=51454&r1=51453&r2=51454&view=diff
==============================================================================
--- cfe/trunk/test/Analysis-Apple/NSString.m (original)
+++ cfe/trunk/test/Analysis-Apple/NSString.m Thu May 22 18:46:11 2008
@@ -43,3 +43,20 @@
CFRetain(s4);
return s4; // expected-warning{{leak}}
}
+
+NSMutableArray* f8() {
+
+ NSString* s = [[NSString alloc] init];
+ NSMutableArray* a = [[NSMutableArray alloc] initWithCapacity:2];
+ [a addObject:s];
+ [s release]; // no-warning
+ return a;
+}
+
+void f9() {
+
+ NSString* s = [[NSString alloc] init];
+ NSString* q = s;
+ [s release];
+ [q release]; // expected-warning {{used after it is released}}
+}
More information about the cfe-commits
mailing list