John McCall | 80c93a0 | 2013-03-01 09:20:14 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-10.7 -emit-llvm -o - %s | FileCheck %s |
| 2 | |
| 3 | // Properly instantiate a non-dependent message expression which |
| 4 | // requires a contextual conversion to ObjC pointer type. |
| 5 | // <rdar://13305374> |
| 6 | @interface Test0 |
| 7 | - (void) foo; |
| 8 | @end |
| 9 | namespace test0 { |
| 10 | struct A { |
| 11 | operator Test0*(); |
| 12 | }; |
| 13 | template <class T> void foo() { |
| 14 | A a; |
| 15 | [a foo]; |
| 16 | } |
| 17 | template void foo<int>(); |
Stephen Lin | 4362261 | 2013-08-15 06:47:53 +0000 | [diff] [blame] | 18 | // CHECK-LABEL: define weak_odr void @_ZN5test03fooIiEEvv() |
John McCall | 80c93a0 | 2013-03-01 09:20:14 +0000 | [diff] [blame] | 19 | // CHECK: [[T0:%.*]] = call [[TEST0:%.*]]* @_ZN5test01AcvP5Test0Ev( |
David Blaikie | a953f28 | 2015-02-27 21:19:58 +0000 | [diff] [blame] | 20 | // CHECK-NEXT: [[T1:%.*]] = load i8*, i8** |
John McCall | 80c93a0 | 2013-03-01 09:20:14 +0000 | [diff] [blame] | 21 | // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST0]]* [[T0]] to i8* |
| 22 | // CHECK-NEXT: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*)*)(i8* [[T2]], i8* [[T1]]) |
| 23 | // CHECK-NEXT: ret void |
| 24 | } |