blob: 83d3b9320b295ba80eab967df34ca856cedc40bc [file] [log] [blame]
Fariborz Jahaniand1250502011-10-17 21:00:22 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
2// rdar://10153365
3
4static int gint;
5struct SetSection {
6 int & at(int __n) { return gint; }
7 const int& at(int __n) const { return gint; }
8};
9
10static 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 {{.*}}* @"\01L_OBJC_SELECTOR_REFERENCES_"
27// CHECK: [[C:%.*]] = call %struct.SetSection* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend
28// CHECK: call i32* @_ZN10SetSection2atEi(%struct.SetSection* [[C]]