summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-11-28 23:12:17 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-11-28 23:12:17 +0000
commitb15c8984ea300624fbbde385d3907667ce1043fa (patch)
tree81bea997c8078dba2e7a52181299f2df85b0dfd2 /test
parenta70c3f8738cc123ded68c183cedd6e93df670c2f (diff)
downloadclang-b15c8984ea300624fbbde385d3907667ce1043fa.tar.gz
objective-C blocks: Make sure that identical logic is used
in deciding a copy/dispose field is needed in a byref structure and when generating the copy/dispose helpers. In certain cases, these fields were being added but no copy/dispose was being generated. This was uncovered in ARC, but not in MRR. // rdar://12759433 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168825 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGenObjC/block-byref-variable-layout.m9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CodeGenObjC/block-byref-variable-layout.m b/test/CodeGenObjC/block-byref-variable-layout.m
index 1e8bcbc11b..6030661af4 100644
--- a/test/CodeGenObjC/block-byref-variable-layout.m
+++ b/test/CodeGenObjC/block-byref-variable-layout.m
@@ -1,5 +1,14 @@
// RUN: %clang_cc1 -fblocks -fobjc-arc -fobjc-runtime-has-weak -triple x86_64-apple-darwin -O0 -emit-llvm %s -o - | FileCheck %s
+// rdar://12759433
+@class NSString;
+
+void Test12759433() {
+ __block __unsafe_unretained NSString *uuByref = (__bridge NSString *)(void*)0x102030405060708;
+ void (^block)() = ^{ uuByref = 0; };
+ block();
+}
+// CHECK: %struct.__block_byref_uuByref = type { i8*, %struct.__block_byref_uuByref*, i32, i32, [[ZERO:%.*]]* }
int main() {
__block __weak id wid;
__block long XXX;