aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-04-07 05:33:18 +0000
committerTed Kremenek <kremenek@apple.com>2009-04-07 05:33:18 +0000
commite82e13ad4ee707d71e320946887f47f45b303e07 (patch)
tree8d23a7d5cf57ca341a1afd99d8252d1353bbd02c
parentf96f16d9f529ec95c20b9a91405653554e9646d1 (diff)
Add test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68505 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Analysis/retain-release.m11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Analysis/retain-release.m b/test/Analysis/retain-release.m
index 6e75b0d321..5a0471ae88 100644
--- a/test/Analysis/retain-release.m
+++ b/test/Analysis/retain-release.m
@@ -272,6 +272,17 @@ void f14_leakimmediately() {
CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks); // expected-warning{{leak}}
}
+// Test that we track an allocated object beyond the point where the *name*
+// of the variable storing the reference is no longer live.
+void f15() {
+ // Create the array.
+ CFMutableArrayRef A = CFArrayCreateMutable(0, 10, &kCFTypeArrayCallBacks);
+ CFMutableArrayRef *B = &A;
+ // At this point, the name 'A' is no longer live.
+ CFRelease(*B); // no-warning
+}
+
+
// Test basic tracking of ivars associated with 'self'. For the retain/release
// checker we currently do not want to flag leaks associated with stores
// of tracked objects to ivars.