summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-01-28 21:20:48 +0000
committerTed Kremenek <kremenek@apple.com>2009-01-28 21:20:48 +0000
commitf675864e3c00b5601f17d8f11d723b12200a1535 (patch)
treea429a6cf30c7759157d7b2bc8c41ae4135d9fb14
parent666bf2044170680b6e705211a221d29f19798f01 (diff)
downloadbcm5719-llvm-f675864e3c00b5601f17d8f11d723b12200a1535.tar.gz
bcm5719-llvm-f675864e3c00b5601f17d8f11d723b12200a1535.zip
Add autorelease test case.
llvm-svn: 63237
-rw-r--r--clang/test/Analysis/retain-release.m7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Analysis/retain-release.m b/clang/test/Analysis/retain-release.m
index 0ce283ff24d..66ff991b097 100644
--- a/clang/test/Analysis/retain-release.m
+++ b/clang/test/Analysis/retain-release.m
@@ -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
+}
+
OpenPOWER on IntegriCloud