1 // RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 | FileCheck %s 2 // RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 -fclang-abi-compat=19 | FileCheck %s --check-prefix=CHECK-CLANG-19 3 4 //CHECK: @_ZTCN16MangleCtorVTable4InstE0_NS_1A4ImplINS1_4WrapEEE 5 //CHECK-CLANG-19: @_ZTCN16MangleCtorVTable4InstE0_NS_1A4ImplINS0_4WrapEEE 6 7 struct X {}; 8 9 // CHECK-LABEL: define{{.*}} void @_Z1f1XS_( 10 void f(X, X) { } 11 12 // CHECK-LABEL: define{{.*}} void @_Z1fR1XS0_( 13 void f(X&, X&) { } 14 15 // CHECK-LABEL: define{{.*}} void @_Z1fRK1XS1_( 16 void f(const X&, const X&) { } 17 18 typedef void T(); 19 struct S {}; 20 21 // CHECK-LABEL: define{{.*}} void @_Z1fPFvvEM1SFvvE( 22 void f(T*, T (S::*)) {} 23 24 namespace A { 25 struct A { }; 26 struct B { }; 27 }; 28 29 // CHECK-LABEL: define{{.*}} void @_Z1fN1A1AENS_1BE( 30 void f(A::A a, A::B b) { } 31 32 struct C { 33 struct D { }; 34 }; 35 36 // CHECK-LABEL: define{{.*}} void @_Z1fN1C1DERS_PS_S1_( 37 void f(C::D, C&, C*, C&) { } 38 39 template<typename T> 40 struct V { 41 typedef int U; 42 }; 43 44 template <typename T> void f1(typename V<T>::U, V<T>) { } 45 46 // CHECK: @_Z2f1IiEvN1VIT_E1UES2_ 47 template void f1<int>(int, V<int>); 48 49 template <typename T> void f2(V<T>, typename V<T>::U) { } 50 51 // CHECK: @_Z2f2IiEv1VIT_ENS2_1UE 52 template void f2<int>(V<int>, int); 53 54 namespace NS { 55 template <typename T> struct S1 {}; 56 template<typename T> void ft3(S1<T>, S1<char>) { } 57 58 // CHECK: @_ZN2NS3ft3IiEEvNS_2S1IT_EENS1_IcEE 59 template void ft3<int>(S1<int>, S1<char>); 60 } 61 62 // PR5196 63 // CHECK: @_Z1fPKcS0_ 64 void f(const char*, const char*) {} 65 66 namespace NS { 67 class C; 68 } 69 70 namespace NS { 71 // CHECK: @_ZN2NS1fERNS_1CE 72 void f(C&) { } 73 } 74 75 namespace Test1 { 76 77 struct A { }; 78 struct B { }; 79 80 // CHECK: @_ZN5Test11fEMNS_1BEFvvENS_1AES3_ 81 void f(void (B::*)(), A, A) { } 82 83 // CHECK: @_ZN5Test11fEMNS_1BEFvvENS_1AES3_MS0_FvS3_EMS3_FvvE 84 void f(void (B::*)(), A, A, void (B::*)(A), void (A::*)()) { } 85 86 } 87 88 namespace ManglePrefix { 89 template <typename> 90 struct X { 91 template <typename> 92 struct Y { 93 typedef int type; 94 typedef int type2; 95 }; 96 }; 97 template <typename T> 98 typename X<T>::template Y<T>::type f(typename X<T>::template Y<T>::type2) { return 0; } 99 100 // CHECK: @_ZN12ManglePrefix1fIiEENS_1XIT_E1YIS2_E4typeENS5_5type2E 101 template int f<int>(int); 102 } 103 104 namespace MangleCtorVTable { 105 namespace A { 106 107 class VBase { 108 public: 109 virtual ~VBase() {}; 110 }; 111 112 struct Wrap {}; 113 114 template <typename T> 115 class Impl : public virtual VBase { 116 public: 117 }; 118 119 } // namespace A 120 121 struct Inst : public A::Impl<A::Wrap> {}; 122 123 void Test() { Inst a; } 124 125 } 126