John McCall | 260611a | 2012-06-20 06:18:46 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - | FileCheck %s |
Fariborz Jahanian | c6ac322 | 2011-10-03 17:58:21 +0000 | [diff] [blame] | 2 | // rdar://10188258 |
| 3 | |
| 4 | struct Foo {int i;}; |
Fariborz Jahanian | bb13c32 | 2011-10-15 17:36:49 +0000 | [diff] [blame] | 5 | static Foo gFoo; |
| 6 | |
Fariborz Jahanian | c6ac322 | 2011-10-03 17:58:21 +0000 | [diff] [blame] | 7 | |
| 8 | @interface ObjCTest { } |
| 9 | @property (nonatomic, readonly) Foo& FooRefProperty; |
Fariborz Jahanian | bb13c32 | 2011-10-15 17:36:49 +0000 | [diff] [blame] | 10 | @property (nonatomic) Foo FooProperty; |
| 11 | - (Foo &) FooProperty; |
| 12 | - (void)setFooProperty : (Foo &) arg; |
Fariborz Jahanian | c6ac322 | 2011-10-03 17:58:21 +0000 | [diff] [blame] | 13 | @end |
| 14 | |
| 15 | |
| 16 | @implementation ObjCTest |
| 17 | @dynamic FooRefProperty; |
| 18 | |
| 19 | -(void) test { |
| 20 | Foo& f = self.FooRefProperty; |
Fariborz Jahanian | bb13c32 | 2011-10-15 17:36:49 +0000 | [diff] [blame] | 21 | Foo& f1 = self.FooProperty; |
Fariborz Jahanian | c6ac322 | 2011-10-03 17:58:21 +0000 | [diff] [blame] | 22 | } |
Fariborz Jahanian | bb13c32 | 2011-10-15 17:36:49 +0000 | [diff] [blame] | 23 | - (Foo &) FooProperty { return gFoo; } |
| 24 | - (void)setFooProperty : (Foo &) arg { }; |
Fariborz Jahanian | c6ac322 | 2011-10-03 17:58:21 +0000 | [diff] [blame] | 25 | @end |
| 26 | |
| 27 | // CHECK: [[T0:%.*]] = load {{%.*}} [[S0:%.*]] |
| 28 | // CHECK: load i8** @"\01L_OBJC_SELECTOR_REFERENCES_ |
| 29 | // CHECK: [[T2:%.*]] = bitcast {{%.*}} [[T0]] to i8* |
| 30 | // CHECK: @objc_msgSend |
Fariborz Jahanian | bb13c32 | 2011-10-15 17:36:49 +0000 | [diff] [blame] | 31 | // CHECK: [[R0:%.*]] = load {{%.*}} [[U0:%.*]] |
| 32 | // CHECK: load i8** @"\01L_OBJC_SELECTOR_REFERENCES_ |
| 33 | // CHECK: [[R2:%.*]] = bitcast {{%.*}} [[R0]] to i8* |
| 34 | // CHECK: @objc_msgSend |
Fariborz Jahanian | c6ac322 | 2011-10-03 17:58:21 +0000 | [diff] [blame] | 35 | |