1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-10.7 -emit-llvm -o - %s | FileCheck %s 2*f4a2713aSLionel Sambuc 3*f4a2713aSLionel Sambuc// Properly instantiate a non-dependent message expression which 4*f4a2713aSLionel Sambuc// requires a contextual conversion to ObjC pointer type. 5*f4a2713aSLionel Sambuc// <rdar://13305374> 6*f4a2713aSLionel Sambuc@interface Test0 7*f4a2713aSLionel Sambuc- (void) foo; 8*f4a2713aSLionel Sambuc@end 9*f4a2713aSLionel Sambucnamespace test0 { 10*f4a2713aSLionel Sambuc struct A { 11*f4a2713aSLionel Sambuc operator Test0*(); 12*f4a2713aSLionel Sambuc }; 13*f4a2713aSLionel Sambuc template <class T> void foo() { 14*f4a2713aSLionel Sambuc A a; 15*f4a2713aSLionel Sambuc [a foo]; 16*f4a2713aSLionel Sambuc } 17*f4a2713aSLionel Sambuc template void foo<int>(); 18*f4a2713aSLionel Sambuc // CHECK-LABEL: define weak_odr void @_ZN5test03fooIiEEvv() 19*f4a2713aSLionel Sambuc // CHECK: [[T0:%.*]] = call [[TEST0:%.*]]* @_ZN5test01AcvP5Test0Ev( 20*f4a2713aSLionel Sambuc // CHECK-NEXT: [[T1:%.*]] = load i8** 21*f4a2713aSLionel Sambuc // CHECK-NEXT: [[T2:%.*]] = bitcast [[TEST0]]* [[T0]] to i8* 22*f4a2713aSLionel Sambuc // CHECK-NEXT: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*)*)(i8* [[T2]], i8* [[T1]]) 23*f4a2713aSLionel Sambuc // CHECK-NEXT: ret void 24*f4a2713aSLionel Sambuc} 25