[cfe-commits] r60720 - /cfe/trunk/test/Analysis/MissingDealloc.m

Ted Kremenek kremenek at apple.com
Mon Dec 8 13:59:22 PST 2008


Author: kremenek
Date: Mon Dec  8 15:59:21 2008
New Revision: 60720

URL: http://llvm.org/viewvc/llvm-project?rev=60720&view=rev
Log:
Add test case for <rdar://problem/6380411>.

Added:
    cfe/trunk/test/Analysis/MissingDealloc.m

Added: cfe/trunk/test/Analysis/MissingDealloc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/MissingDealloc.m?rev=60720&view=auto

==============================================================================
--- cfe/trunk/test/Analysis/MissingDealloc.m (added)
+++ cfe/trunk/test/Analysis/MissingDealloc.m Mon Dec  8 15:59:21 2008
@@ -0,0 +1,23 @@
+// RUN: clang -warn-objc-missing-dealloc '-DIBOutlet=__attribute__((iboutlet))' %s --verify
+typedef signed char BOOL;
+ at protocol NSObject  - (BOOL)isEqual:(id)object; @end
+ at interface NSObject <NSObject> {}
+- (void)dealloc;
+ at end
+
+// <rdar://problem/6380411>: 'myproperty' has kind 'assign' and thus the
+//  assignment through the setter does not perform a release.
+
+ at interface MyObject : NSObject {
+  id _myproperty;  
+}
+ at property(assign) id myproperty;
+ at end
+
+ at implementation MyObject
+ at synthesize myproperty=_myproperty; // no-warning
+- (void)dealloc {
+  self.myproperty = 0;
+  [super dealloc]; 
+}
+ at end





More information about the cfe-commits mailing list