From: Ted Kremenek Date: Mon, 8 Dec 2008 22:01:50 +0000 (+0000) Subject: Incorporate MissingDeallc_SEL.m test case into MissingDealloc.m X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=63de73635611b4cdc57eff94b36e9525b363281a;p=clang Incorporate MissingDeallc_SEL.m test case into MissingDealloc.m git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60721 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/MissingDealloc.m b/test/Analysis/MissingDealloc.m index 1a3a408167..62a53047bc 100644 --- a/test/Analysis/MissingDealloc.m +++ b/test/Analysis/MissingDealloc.m @@ -3,8 +3,11 @@ typedef signed char BOOL; @protocol NSObject - (BOOL)isEqual:(id)object; @end @interface NSObject {} - (void)dealloc; +- (id)init; @end +typedef struct objc_selector *SEL; + // : 'myproperty' has kind 'assign' and thus the // assignment through the setter does not perform a release. @@ -21,3 +24,24 @@ typedef signed char BOOL; [super dealloc]; } @end + +//===------------------------------------------------------------------------=== +// Don't warn about iVars that are selectors. + +@interface TestSELs : NSObject { + SEL a; + SEL b; +} + +@end + +@implementation TestSELs // no-warning +- (id)init { + if( (self = [super init]) ) { + a = @selector(a); + b = @selector(b); + } + + return self; +} +@end diff --git a/test/Analysis/MissingDealloc_SEL.m b/test/Analysis/MissingDealloc_SEL.m deleted file mode 100644 index be3e0b7af8..0000000000 --- a/test/Analysis/MissingDealloc_SEL.m +++ /dev/null @@ -1,30 +0,0 @@ -// RUN: clang -warn-objc-missing-dealloc -verify %s - -typedef struct objc_selector *SEL; -typedef signed char BOOL; -typedef unsigned int NSUInteger; -typedef struct _NSZone NSZone; -@protocol NSObject -- (BOOL)isEqual:(id)object; -@end -@interface NSObject {} -- (id)init; -@end - -@interface TestSELs : NSObject { - SEL a; - SEL b; -} - -@end - -@implementation TestSELs // no-warning -- (id)init { - if( (self = [super init]) ) { - a = @selector(a); - b = @selector(b); - } - - return self; -} -@end