John McCall | 260611a | 2012-06-20 06:18:46 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s |
Fariborz Jahanian | a762514 | 2010-11-18 22:39:16 +0000 | [diff] [blame] | 2 | // rdar://8681766 |
| 3 | |
| 4 | @interface NSArray |
| 5 | - (NSArray*) retain; |
| 6 | - (void) release; |
| 7 | @end |
| 8 | |
| 9 | void NSAssignArray(NSArray*& target, NSArray* newValue) |
| 10 | { |
| 11 | if (target == newValue) |
| 12 | return; |
| 13 | |
| 14 | NSArray* oldValue = target; |
| 15 | |
| 16 | target = [newValue retain]; |
| 17 | |
| 18 | [oldValue release]; |
| 19 | } |
| 20 | // CHECK: {{call.* @objc_assign_strongCast}} |