diff options
Diffstat (limited to 'clang/test/CodeGenObjCXX/refence-assign-write-barrier.mm')
-rw-r--r-- | clang/test/CodeGenObjCXX/refence-assign-write-barrier.mm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjCXX/refence-assign-write-barrier.mm b/clang/test/CodeGenObjCXX/refence-assign-write-barrier.mm new file mode 100644 index 0000000..206ecb0 --- /dev/null +++ b/clang/test/CodeGenObjCXX/refence-assign-write-barrier.mm @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin10 -fobjc-fragile-abi -emit-llvm -o - %s | FileCheck %s +// rdar://8681766 + +@interface NSArray +- (NSArray*) retain; +- (void) release; +@end + +void NSAssignArray(NSArray*& target, NSArray* newValue) +{ + if (target == newValue) + return; + + NSArray* oldValue = target; + + target = [newValue retain]; + + [oldValue release]; +} +// CHECK: {{call.* @objc_assign_strongCast}} |