xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjC/gc-weak-attribute.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o - %s | FileCheck %s
2*f4a2713aSLionel Sambuc// rdar://10073896
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuc@interface I
5*f4a2713aSLionel Sambuc{
6*f4a2713aSLionel Sambuc  __weak id wObject;
7*f4a2713aSLionel Sambuc}
8*f4a2713aSLionel Sambuc@property (readwrite, weak) id representedObject;
9*f4a2713aSLionel Sambuc@property (readwrite, weak) id wObject;
10*f4a2713aSLionel Sambuc@property (readwrite, weak) __weak id wRandom;
11*f4a2713aSLionel Sambuc@property (readwrite, assign) __weak id wAnother;
12*f4a2713aSLionel Sambuc@end
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambuc@implementation I
15*f4a2713aSLionel Sambuc@synthesize representedObject;
16*f4a2713aSLionel Sambuc@synthesize wObject;
17*f4a2713aSLionel Sambuc@synthesize wRandom;
18*f4a2713aSLionel Sambuc@synthesize wAnother;
19*f4a2713aSLionel Sambuc@end
20*f4a2713aSLionel Sambuc// CHECK:  call i8* @objc_read_weak
21*f4a2713aSLionel Sambuc// CHECK:  call i8* @objc_assign_weak
22*f4a2713aSLionel Sambuc// CHECK:  call i8* @objc_read_weak
23*f4a2713aSLionel Sambuc// CHECK:  call i8* @objc_assign_weak
24*f4a2713aSLionel Sambuc// CHECK:  call i8* @objc_read_weak
25*f4a2713aSLionel Sambuc// CHECK:  call i8* @objc_assign_weak
26*f4a2713aSLionel Sambuc// CHECK:  call i8* @objc_read_weak
27*f4a2713aSLionel Sambuc// CHECK:  call i8* @objc_assign_weak
28*f4a2713aSLionel Sambuc
29