26 lines · plain
1// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-arc -fobjc-runtime-has-weak %s -emit-llvm -o - | FileCheck %s2 3// CHECK-DAG: llvm.objc.destroyWeak(ptr %self_weak_s_w_s)4// CHECK-DAG: llvm.objc.storeStrong(ptr %self_strong_w_s, ptr null)5// CHECK-DAG: llvm.objc.destroyWeak(ptr %self_weak_s)6// CHECK-DAG: llvm.objc.destroyWeak(ptr %self_weak_s3)7// CHECK-DAG: llvm.objc.storeStrong(ptr %self_strong3, ptr null)8// CHECK-DAG: llvm.objc.storeStrong(ptr %self_strong2, ptr null)9// CHECK-DAG: llvm.objc.storeStrong(ptr %self_strong, ptr null)10@interface NSObject11@end12@interface A : NSObject13@end14@implementation A15- (void)test {16 __attribute__((objc_ownership(strong))) __typeof__(self) self_strong;17 __attribute__((objc_ownership(strong))) __typeof__(self_strong) self_strong2;18 __attribute__((objc_ownership(strong))) __typeof__(self_strong2) self_strong3;19 __attribute__((objc_ownership(weak))) __typeof__(self_strong3) self_weak_s3;20 21 __attribute__((objc_ownership(weak))) __typeof__(self_strong) self_weak_s;22 __attribute__((objc_ownership(strong))) __typeof__(self_weak_s) self_strong_w_s;23 __attribute__((objc_ownership(weak))) __typeof__(self_strong_w_s) self_weak_s_w_s;24}25@end26