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