diff options
author | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-09 23:20:13 +0000 |
---|---|---|
committer | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-09 23:20:13 +0000 |
commit | 56dc9c7e121493f4a4225bbfa4be4d65b1753c66 (patch) | |
tree | 3dd34a8c34793776e40587f22f12789ab230d69d /gcc/testsuite/objc.dg/super-dealloc-1.m | |
parent | 9e0f9ffc44b45e738ae0321183bdc41f7c889c81 (diff) |
This commit was manufactured by cvs2svn to create tagapple/gcc-5000
'apple-gcc-5000'.
git-svn-id: https://gcc.gnu.org/svn/gcc/tags/apple-gcc-5000@96220 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/objc.dg/super-dealloc-1.m')
-rw-r--r-- | gcc/testsuite/objc.dg/super-dealloc-1.m | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/super-dealloc-1.m b/gcc/testsuite/objc.dg/super-dealloc-1.m new file mode 100644 index 00000000000..b87af921860 --- /dev/null +++ b/gcc/testsuite/objc.dg/super-dealloc-1.m @@ -0,0 +1,47 @@ +/* APPLE LOCAL file ObjC super dealloc */ +/* Check for warnings about missing [super dealloc] calls. */ +/* Author: Ziemowit Laski <zlaski@apple.com> */ + +/* { dg-do compile } */ + +@interface Foo { + void *isa; +} +- (void) dealloc; +- (void) some_other; +@end + +@interface Bar: Foo { + void *casa; +} +- (void) dealloc; +@end + +@interface Baz: Bar { + void *usa; +} +- (void) dealloc; +@end + +@implementation Foo +- (void) dealloc { + isa = 0; /* Should not warn here. */ +} +- (void) some_other { + isa = (void *)-1; +} +@end + +@implementation Bar +- (void) dealloc { + casa = 0; + [super some_other]; +} /* { dg-warning "method possibly missing a .super dealloc. call" } */ +@end + +@implementation Baz +- (void) dealloc { + usa = 0; + [super dealloc]; /* Should not warn here. */ +} +@end |