2007-03-01 Paul Brook <paul@codesourcery.com>
[official-gcc.git] / gcc / testsuite / objc.dg / super-dealloc-1.m
blob0ab177bb73c9f0d2e6979279435d71a616626137
1 /* Check for warnings about missing [super dealloc] calls.  */
2 /* Author: Ziemowit Laski <zlaski@apple.com>  */
4 /* { dg-do compile } */
6 @interface Foo {
7   void *isa;
9 - (void) dealloc;
10 - (void) some_other;
11 @end
13 @interface Bar: Foo {
14   void *casa;
16 - (void) dealloc;
17 @end
19 @interface Baz: Bar {
20   void *usa;
22 - (void) dealloc;
23 @end
25 @implementation Foo
26 - (void) dealloc {
27   isa = 0;   /* Should not warn here.  */
29 - (void) some_other {
30   isa = (void *)-1;
32 @end
34 @implementation Bar
35 - (void) dealloc {
36   casa = 0;
37   [super some_other];
38 }  /* { dg-warning "method possibly missing a .super dealloc. call" } */
39 @end
41 @implementation Baz
42 - (void) dealloc {
43   usa = 0;
44   [super dealloc];  /* Should not warn here.  */
46 @end