summaryrefslogtreecommitdiff
path: root/clang/test/CodeGenObjCXX/refence-assign-write-barrier.mm
blob: 206ecb0c29e3fbca7f604d8b9aa6b9846af75129 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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}}