aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenObjCXX/refence-assign-write-barrier.mm
blob: ad277ef6d596418d296164173dc520170a340429 (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-runtime=macosx-fragile-10.5 -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}}