]> granicus.if.org Git - clang/commitdiff
Update test case to include a leak that occurs at the place of allocation.
authorTed Kremenek <kremenek@apple.com>
Thu, 19 Feb 2009 18:20:28 +0000 (18:20 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 19 Feb 2009 18:20:28 +0000 (18:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65048 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/retain-release.m

index cff7b9be6033c2c03af46342e00beaa7bcd0a0a1..4ed6b000c3b7ee8a857b2d4d72ebaa57b6b2d55b 100644 (file)
@@ -236,4 +236,8 @@ void f13_autorelease() {
   CFMutableArrayRef A = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks);
   [(id) A autorelease]; // no-warning
 }
-  
+
+// This case exercises the logic where the leak site is the same as the allocation site.
+void f14_leakimmediately() {
+  CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // expected-warning{{leak}}
+}