Fariborz Jahanian | d125050 | 2011-10-17 21:00:22 +0000 | [diff] [blame] | 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 {{.*}}* @"\01L_OBJC_SELECTOR_REFERENCES_" |
| 27 | // CHECK: [[C:%.*]] = call %struct.SetSection* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend |
| 28 | // CHECK: call i32* @_ZN10SetSection2atEi(%struct.SetSection* [[C]] |