summaryrefslogtreecommitdiffstats
path: root/test/SemaObjC/dealloc.m
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-07-30 20:52:48 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-07-30 20:52:48 +0000
commit1b0a13e91088f6818016464ffb23616ced820cbc (patch)
tree0dc3f1557e2c967153f56139d7fd80c5aad70973 /test/SemaObjC/dealloc.m
parent2d18419a7c8f9a2975d4ed74a202de6467308ad1 (diff)
objective-c arc: ARC IRGen correctly assumes result
type of generated call to super dealloc is 'void' and asserts if user's dealloc is not of 'void type. This rule must be enforced in clang front-end (with a fixit) if this is not the case, instead of asserting in CodeGen. // rdar://11987838 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160993 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaObjC/dealloc.m')
-rw-r--r--test/SemaObjC/dealloc.m25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/SemaObjC/dealloc.m b/test/SemaObjC/dealloc.m
new file mode 100644
index 0000000000..feafafd375
--- /dev/null
+++ b/test/SemaObjC/dealloc.m
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -fblocks -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -fblocks -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// rdar://11987838
+
+@protocol NSObject
+- dealloc; // expected-error {{return type must be correctly specified as 'void' under ARC, instead of 'id'}}
+// CHECK: fix-it:"{{.*}}":{6:3-6:3}:"(void)"
+@end
+
+@protocol Foo <NSObject> @end
+
+@interface Root <Foo>
+@end
+
+@interface Baz : Root {
+}
+@end
+
+@implementation Baz
+- (id) dealloc { // expected-error {{return type must be correctly specified as 'void' under ARC, instead of 'id'}}
+// CHECK: fix-it:"{{.*}}":{20:5-20:7}:"void"
+}
+
+@end
+