[cfe-commits] r64494 - /cfe/trunk/test/Analysis/MissingDealloc.m
Ted Kremenek
kremenek at apple.com
Fri Feb 13 14:26:30 PST 2009
Author: kremenek
Date: Fri Feb 13 16:26:30 2009
New Revision: 64494
URL: http://llvm.org/viewvc/llvm-project?rev=64494&view=rev
Log:
Add test case illustrating special handling of 'SenTestCase' subclasses for the missing -dealloc check.
Modified:
cfe/trunk/test/Analysis/MissingDealloc.m
Modified: cfe/trunk/test/Analysis/MissingDealloc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/MissingDealloc.m?rev=64494&r1=64493&r2=64494&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/MissingDealloc.m (original)
+++ cfe/trunk/test/Analysis/MissingDealloc.m Fri Feb 13 16:26:30 2009
@@ -1,6 +1,10 @@
// RUN: clang -analyze -warn-objc-missing-dealloc '-DIBOutlet=__attribute__((iboutlet))' %s --verify
typedef signed char BOOL;
- at protocol NSObject - (BOOL)isEqual:(id)object; @end
+ at protocol NSObject
+- (BOOL)isEqual:(id)object;
+- (Class)class;
+ at end
+
@interface NSObject <NSObject> {}
- (void)dealloc;
- (id)init;
@@ -83,3 +87,31 @@
[super dealloc];
}
@end
+
+//===------------------------------------------------------------------------===
+// PR 3187: http://llvm.org/bugs/show_bug.cgi?id=3187
+// - Disable the missing -dealloc check for classes that subclass SenTestCase
+
+ at class NSString;
+
+ at interface SenTestCase : NSObject {}
+ at end
+
+ at interface MyClassTest : SenTestCase {
+ NSString *resourcePath;
+}
+ at end
+
+ at interface NSBundle : NSObject {}
++ (NSBundle *)bundleForClass:(Class)aClass;
+- (NSString *)resourcePath;
+ at end
+
+ at implementation MyClassTest
+- (void)setUp {
+ resourcePath = [[NSBundle bundleForClass:[self class]] resourcePath];
+}
+- (void)testXXX {
+ // do something which uses resourcepath
+}
+ at end
More information about the cfe-commits
mailing list