Home | History | Annotate | Download | only in CodeGenObjCXX
      1 // RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - | FileCheck %s
      2 // rdar://10188258
      3 
      4 struct Foo {int i;};
      5 static Foo gFoo;
      6 
      7 
      8 @interface ObjCTest  { }
      9 @property (nonatomic, readonly) Foo& FooRefProperty;
     10 @property (nonatomic) Foo  FooProperty;
     11 - (Foo &) FooProperty;
     12 - (void)setFooProperty : (Foo &) arg;
     13 @end
     14 
     15 
     16 @implementation ObjCTest
     17 @dynamic FooRefProperty;
     18 
     19 -(void) test {
     20     Foo& f = self.FooRefProperty;
     21     Foo& f1 = self.FooProperty;
     22 }
     23 - (Foo &) FooProperty { return gFoo; }
     24 - (void)setFooProperty : (Foo &) arg {  };
     25 @end
     26 
     27 // CHECK: [[T0:%.*]] = load {{%.*}} [[S0:%.*]]
     28 // CHECK: load i8*, i8** @OBJC_SELECTOR_REFERENCES_
     29 // CHECK:  [[T2:%.*]]  = bitcast {{%.*}} [[T0]] to i8*
     30 // CHECK:  @objc_msgSend
     31 // CHECK: [[R0:%.*]] = load {{%.*}} [[U0:%.*]]
     32 // CHECK: load i8*, i8** @OBJC_SELECTOR_REFERENCES_
     33 // CHECK:  [[R2:%.*]]  = bitcast {{%.*}} [[R0]] to i8*
     34 // CHECK:  @objc_msgSend
     35 
     36