aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/super-dealloc-1.mm
diff options
context:
space:
mode:
authorno-author <no-author@gcc.gnu.org>2005-03-21 22:51:24 +0000
committerno-author <no-author@gcc.gnu.org>2005-03-21 22:51:24 +0000
commit8c0c5eaf3e41653f147ad3ec99e1fb1b1c1a8943 (patch)
tree385606c037cd628e6bfd1e621183b3a8dbc265f9 /gcc/testsuite/obj-c++.dg/super-dealloc-1.mm
parent9e88bc8754ac91301313180a1f11bbf74ed1a9dc (diff)
This commit was manufactured by cvs2svn to create tagapple/gcc-5002
'apple-gcc-5002'. git-svn-id: https://gcc.gnu.org/svn/gcc/tags/apple-gcc-5002@96841 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/super-dealloc-1.mm')
-rw-r--r--gcc/testsuite/obj-c++.dg/super-dealloc-1.mm47
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/testsuite/obj-c++.dg/super-dealloc-1.mm b/gcc/testsuite/obj-c++.dg/super-dealloc-1.mm
new file mode 100644
index 00000000000..b87af921860
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/super-dealloc-1.mm
@@ -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