diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-11-28 23:12:17 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-11-28 23:12:17 +0000 |
commit | 998f0a336012e25f72acdd53f5a6b1cf34904e7a (patch) | |
tree | 44445d6cf7591273ebfa21531e6243a424a18206 /clang/test/CodeGenObjC/block-byref-variable-layout.m | |
parent | a118c6a8c0e9a6fa107460682d4ded421631941a (diff) | |
download | bcm5719-llvm-998f0a336012e25f72acdd53f5a6b1cf34904e7a.tar.gz bcm5719-llvm-998f0a336012e25f72acdd53f5a6b1cf34904e7a.zip |
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
llvm-svn: 168825
Diffstat (limited to 'clang/test/CodeGenObjC/block-byref-variable-layout.m')
-rw-r--r-- | clang/test/CodeGenObjC/block-byref-variable-layout.m | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/block-byref-variable-layout.m b/clang/test/CodeGenObjC/block-byref-variable-layout.m index 1e8bcbc11ba..6030661af4d 100644 --- a/clang/test/CodeGenObjC/block-byref-variable-layout.m +++ b/clang/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; |