diff --git a/clang/test/Analysis/retain-release.m b/clang/test/Analysis/retain-release.m index cff7b9be6033..4ed6b000c3b7 100644 --- a/clang/test/Analysis/retain-release.m +++ b/clang/test/Analysis/retain-release.m @@ -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}} +}