blob: fcf9b29785d434d15701abd61c1c26e103ed09ea [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_"
Stephen Hinesef822542014-07-21 00:47:37 -070027// CHECK: [[C:%.*]] = call nonnull %struct.SetSection* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend
28// CHECK: call nonnull i32* @_ZN10SetSection2atEi(%struct.SetSection* [[C]]