aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/obj-c++.dg/super-dealloc-1.mm
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/obj-c++.dg/super-dealloc-1.mm')
-rw-r--r--gcc-4.9/gcc/testsuite/obj-c++.dg/super-dealloc-1.mm46
1 files changed, 46 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/obj-c++.dg/super-dealloc-1.mm b/gcc-4.9/gcc/testsuite/obj-c++.dg/super-dealloc-1.mm
new file mode 100644
index 000000000..0ab177bb7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/obj-c++.dg/super-dealloc-1.mm
@@ -0,0 +1,46 @@
+/* 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