diff options
author | John McCall <rjmccall@apple.com> | 2012-01-29 07:46:59 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2012-01-29 07:46:59 +0000 |
commit | 77fe6cd58f284bcc0130b8fd90018d7e5a960b56 (patch) | |
tree | 8f58226dbd97b34ad5bc345b667443727661bd13 /test/CodeGenObjC | |
parent | f48f79636d5506d15784c2c2fa8a02086adda40a (diff) |
When emitting an ARC epilogue that looks like a return of 'self',
kill the retain from the return site.
This has the workaround nature. It's badness all around.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149193 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenObjC')
-rw-r--r-- | test/CodeGenObjC/arc.m | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGenObjC/arc.m b/test/CodeGenObjC/arc.m index 1a020e2a52..e367c8c19d 100644 --- a/test/CodeGenObjC/arc.m +++ b/test/CodeGenObjC/arc.m @@ -1521,3 +1521,14 @@ void test68(void) { // CHECK-NEXT: [[T2:%.*]] = load i8** [[CL]] // CHECK-NEXT: call void @objc_release(i8* [[T2]]) // CHECK-NEXT: ret void + +// rdar://problem/10564852 +@interface Test69 @end +@implementation Test69 +- (id) foo { return self; } +@end +// CHECK: define internal i8* @"\01-[Test69 foo]"( +// CHECK: [[SELF:%.*]] = alloca [[TEST69:%.*]]*, align 8 +// CHECK: [[T0:%.*]] = load [[TEST69]]** [[SELF]], align 8 +// CHECK-NEXT: [[T1:%.*]] = bitcast [[TEST69]]* [[T0]] to i8* +// CHECK-NEXT: ret i8* [[T1]] |