1// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-arc -fobjc-runtime-has-weak %s -emit-llvm -o - | FileCheck %s
2
3// CHECK: bitcast {{.*}} %self_weak_s_w_s
4// CHECK-NEXT: llvm.objc.destroyWeak
5// CHECK-NEXT: bitcast {{.*}} %self_strong_w_s
6// CHECK-NEXT: llvm.objc.storeStrong
7// CHECK-NEXT: bitcast {{.*}} %self_weak_s
8// CHECK-NEXT: llvm.objc.destroyWeak
9// CHECK-NEXT: bitcast {{.*}} %self_weak_s3
10// CHECK-NEXT: llvm.objc.destroyWeak
11// CHECK-NEXT: bitcast {{.*}} %self_strong3
12// CHECK-NEXT: llvm.objc.storeStrong
13// CHECK-NEXT: bitcast {{.*}} %self_strong2
14// CHECK-NEXT: llvm.objc.storeStrong
15// CHECK-NEXT: bitcast {{.*}} %self_strong
16// CHECK-NEXT: llvm.objc.storeStrong
17@interface NSObject
18@end
19@interface A : NSObject
20@end
21@implementation A
22- (void)test {
23  __attribute__((objc_ownership(strong))) __typeof__(self) self_strong;
24  __attribute__((objc_ownership(strong))) __typeof__(self_strong) self_strong2;
25  __attribute__((objc_ownership(strong))) __typeof__(self_strong2) self_strong3;
26  __attribute__((objc_ownership(weak))) __typeof__(self_strong3) self_weak_s3;
27
28  __attribute__((objc_ownership(weak))) __typeof__(self_strong) self_weak_s;
29  __attribute__((objc_ownership(strong))) __typeof__(self_weak_s) self_strong_w_s;
30  __attribute__((objc_ownership(weak))) __typeof__(self_strong_w_s) self_weak_s_w_s;
31}
32@end
33