]> granicus.if.org Git - clang/commitdiff
Add autorelease test case.
authorTed Kremenek <kremenek@apple.com>
Wed, 28 Jan 2009 21:20:48 +0000 (21:20 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 28 Jan 2009 21:20:48 +0000 (21:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63237 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/retain-release.m

index 0ce283ff24d25dd8ef56fa683a0a3bc685581987..66ff991b09766a779715ff2f280690597ce1466d 100644 (file)
@@ -47,6 +47,7 @@ typedef struct _NSZone NSZone;
 @protocol NSObject  - (BOOL)isEqual:(id)object;
 - (id)retain;
 - (oneway void)release;
+- (id)autorelease;
 @end  @protocol NSCopying  - (id)copyWithZone:(NSZone *)zone;
 @end  @protocol NSCoding  - (void)encodeWithCoder:(NSCoder *)aCoder;
 @end    @interface NSObject <NSObject> {
@@ -230,3 +231,9 @@ CREATEFUN MyCreateFun;
 void f12() {
   CFTypeRef o = MyCreateFun(); // expected-warning {{leak}}
 }
+
+void f13_autorelease() {
+  CFMutableArrayRef A = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks);
+  [(id) A autorelease]; // no-warning
+}
+