Home | History | Annotate | Download | only in CodeGenObjCXX
      1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
      2 // rdar://10153365
      3 
      4 static int gint;
      5 struct SetSection { 
      6       int & at(int __n) { return gint; }
      7       const int& at(int __n) const { return gint; }
      8 };
      9 
     10 static SetSection gSetSection;
     11 
     12 @interface SetShow
     13 - (SetSection&)sections;
     14 @end
     15 
     16 @implementation SetShow
     17 - (SetSection&) sections {
     18 //  [self sections].at(100);
     19     self.sections.at(100);
     20    return gSetSection;
     21 }
     22 @end
     23 
     24 // CHECK: [[SELF:%.*]] = alloca [[T6:%.*]]*, align
     25 // CHECK: [[T0:%.*]] = load {{.*}}, {{.*}}* [[SELF]], align
     26 // CHECK: [[T1:%.*]] = load {{.*}}, {{.*}}* @OBJC_SELECTOR_REFERENCES_
     27 // CHECK: [[C:%.*]] = call dereferenceable({{[0-9]+}}) %struct.SetSection* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend
     28 // CHECK: call dereferenceable({{[0-9]+}}) i32* @_ZN10SetSection2atEi(%struct.SetSection* [[C]]
     29