summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-09-06 23:47:02 +0000
committerTed Kremenek <kremenek@apple.com>2012-09-06 23:47:02 +0000
commitc008db99d701ca2ea534e71610e5452357051b0a (patch)
tree1c43846108ba6edb283fb902ea3d5d024282819e /clang/test
parent7e97996f4e6a9a1146ed2bbb7fc84c45455e1729 (diff)
downloadbcm5719-llvm-c008db99d701ca2ea534e71610e5452357051b0a.tar.gz
bcm5719-llvm-c008db99d701ca2ea534e71610e5452357051b0a.zip
Teach RetainCountChecker that CFPlugInInstanceCreate does not
return a CF object at all. Fixes <rdar://problem/9566345> llvm-svn: 163362
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Analysis/retain-release.m12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Analysis/retain-release.m b/clang/test/Analysis/retain-release.m
index 9d2aa756b28..3a9649c7412 100644
--- a/clang/test/Analysis/retain-release.m
+++ b/clang/test/Analysis/retain-release.m
@@ -303,6 +303,10 @@ extern CGColorSpaceRef CGColorSpaceCreateDeviceRGB(void);
// This is how NSMakeCollectable is declared in the OS X 10.8 headers.
id NSMakeCollectable(CFTypeRef __attribute__((cf_consumed))) __attribute__((ns_returns_retained));
+typedef const struct __CFUUID * CFUUIDRef;
+
+extern
+void *CFPlugInInstanceCreate(CFAllocatorRef allocator, CFUUIDRef factoryUUID, CFUUIDRef typeUUID);
//===----------------------------------------------------------------------===//
// Test cases.
@@ -1907,3 +1911,11 @@ void test_custom_cf() {
MyCFType x = CreateMyCFType(); // expected-warning {{leak of an object stored into 'x'}}
}
+//===----------------------------------------------------------------------===//
+// Test calling CFPlugInInstanceCreate, which appears in CF but doesn't
+// return a CF object.
+//===----------------------------------------------------------------------===//
+
+void test_CFPlugInInstanceCreate(CFUUIDRef factoryUUID, CFUUIDRef typeUUID) {
+ CFPlugInInstanceCreate(kCFAllocatorDefault, factoryUUID, typeUUID); // no-warning
+}
OpenPOWER on IntegriCloud