1 @protocol NSCopying @end
3 __attribute__((objc_root_class))
4 @interface NSObject <NSCopying>
8 @implementation NSObject
10 // Root class, shouldn't warn
13 // Root class, shouldn't warn
17 @interface Subclass1 : NSObject
22 @implementation Subclass1
29 @interface Subclass2 : NSObject
34 @implementation Subclass2
36 [super dealloc]; // Shouldn't warn
39 [super finalize]; // Shouldn't warn
43 // RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck %s
44 // CHECK: warn-missing-super.m:24:1: warning: method possibly missing a [super dealloc] call
45 // CHECK: 1 warning generated.
47 // RUN: %clang_cc1 -fsyntax-only -fobjc-gc %s 2>&1 | FileCheck --check-prefix=CHECK-GC %s
48 // CHECK-GC: warn-missing-super.m:24:1: warning: method possibly missing a [super dealloc] call
49 // CHECK-GC: warn-missing-super.m:26:1: warning: method possibly missing a [super finalize] call
50 // CHECK-GC: 2 warnings generated.
52 // RUN: %clang_cc1 -fsyntax-only -fobjc-gc-only %s 2>&1 | FileCheck --check-prefix=CHECK-GC-ONLY %s
53 // CHECK-GC-ONLY: warn-missing-super.m:26:1: warning: method possibly missing a [super finalize] call
54 // CHECK-GC-ONLY: 1 warning generated.
56 // RUN: not %clang_cc1 -fsyntax-only -triple x86_64-apple-darwin10 -fobjc-arc %s 2>&1 | FileCheck --check-prefix=CHECK-ARC %s
57 // CHECK-ARC: warn-missing-super.m:36:10: error: ARC forbids explicit message send of 'dealloc'
58 // CHECK-ARC: 1 error generated.