blob: b2942448758dda04b2b67f2df52d886689260f78 [file] [log] [blame]
John McCall80c93a02013-03-01 09:20:14 +00001// 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
9namespace 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 Lin43622612013-08-15 06:47:53 +000018 // CHECK-LABEL: define weak_odr void @_ZN5test03fooIiEEvv()
John McCall80c93a02013-03-01 09:20:14 +000019 // CHECK: [[T0:%.*]] = call [[TEST0:%.*]]* @_ZN5test01AcvP5Test0Ev(
David Blaikiea953f282015-02-27 21:19:58 +000020 // CHECK-NEXT: [[T1:%.*]] = load i8*, i8**
John McCall80c93a02013-03-01 09:20:14 +000021 // 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}