]> granicus.if.org Git - clang/commitdiff
Test case: When using RegionStore with the retain/release checker, stop tracking...
authorTed Kremenek <kremenek@apple.com>
Thu, 5 Mar 2009 05:14:55 +0000 (05:14 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 5 Mar 2009 05:14:55 +0000 (05:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66139 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/retain-release-region-store.m

index ca040743b149eb546fbc414c74bc561db51448e9..651ffa76dfbff0d373cb6aa883ca365ca1648ccb 100644 (file)
@@ -99,3 +99,20 @@ CFAbsoluteTime f4() {
   return t;
 }
 
+// Test that assigning to an self.ivar loses track of an object.
+// This is a temporary hack to reduce false positives.
+@interface Test3 : NSObject {
+  id myObj;
+}
+- (void)test_self_assign_ivar;
+@end
+
+@implementation Test3
+- (void)test_self_assign_ivar {
+  CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
+  CFDateRef date = CFDateCreate(0, t); // no-warning
+  myObj = (id) date;
+}
+@end
+
+