• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
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>();
18  // CHECK-LABEL:    define weak_odr void @_ZN5test03fooIiEEvv()
19  // CHECK:      [[T0:%.*]] = call [[TEST0:%.*]]* @_ZN5test01AcvP5Test0Ev(
20  // CHECK-NEXT: [[T1:%.*]] = load i8*, i8**
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}
25