2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 | FileCheck %s
|
2009-09-17 08:43:46 +08:00
|
|
|
|
|
|
|
struct X {};
|
|
|
|
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define void @_Z1f1XS_(
|
2009-09-17 08:43:46 +08:00
|
|
|
void f(X, X) { }
|
|
|
|
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define void @_Z1fR1XS0_(
|
2009-09-17 08:43:46 +08:00
|
|
|
void f(X&, X&) { }
|
|
|
|
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define void @_Z1fRK1XS1_(
|
2009-09-17 08:43:46 +08:00
|
|
|
void f(const X&, const X&) { }
|
|
|
|
|
|
|
|
typedef void T();
|
|
|
|
struct S {};
|
|
|
|
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define void @_Z1fPFvvEM1SFvvE(
|
2009-09-17 08:43:46 +08:00
|
|
|
void f(T*, T (S::*)) {}
|
|
|
|
|
2009-09-17 12:16:28 +08:00
|
|
|
namespace A {
|
|
|
|
struct A { };
|
|
|
|
struct B { };
|
|
|
|
};
|
|
|
|
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define void @_Z1fN1A1AENS_1BE(
|
2009-09-17 12:16:28 +08:00
|
|
|
void f(A::A a, A::B b) { }
|
2009-09-26 11:55:37 +08:00
|
|
|
|
|
|
|
struct C {
|
|
|
|
struct D { };
|
|
|
|
};
|
|
|
|
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define void @_Z1fN1C1DERS_PS_S1_(
|
2009-09-26 11:55:37 +08:00
|
|
|
void f(C::D, C&, C*, C&) { }
|
2009-09-27 09:06:07 +08:00
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
struct V {
|
|
|
|
typedef int U;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <typename T> void f1(typename V<T>::U, V<T>) { }
|
|
|
|
|
|
|
|
// CHECK: @_Z2f1IiEvN1VIT_E1UES2_
|
|
|
|
template void f1<int>(int, V<int>);
|
|
|
|
|
|
|
|
template <typename T> void f2(V<T>, typename V<T>::U) { }
|
|
|
|
|
|
|
|
// CHECK: @_Z2f2IiEv1VIT_ENS2_1UE
|
|
|
|
template void f2<int>(V<int>, int);
|
2009-09-28 03:53:49 +08:00
|
|
|
|
|
|
|
namespace NS {
|
|
|
|
template <typename T> struct S1 {};
|
|
|
|
template<typename T> void ft3(S1<T>, S1<char>) { }
|
|
|
|
|
|
|
|
// CHECK: @_ZN2NS3ft3IiEEvNS_2S1IT_EENS1_IcEE
|
|
|
|
template void ft3<int>(S1<int>, S1<char>);
|
|
|
|
}
|
2009-10-16 10:06:06 +08:00
|
|
|
|
|
|
|
// PR5196
|
|
|
|
// CHECK: @_Z1fPKcS0_
|
|
|
|
void f(const char*, const char*) {}
|
|
|
|
|
2009-11-07 12:26:04 +08:00
|
|
|
namespace NS {
|
|
|
|
class C;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace NS {
|
|
|
|
// CHECK: @_ZN2NS1fERNS_1CE
|
|
|
|
void f(C&) { }
|
|
|
|
}
|
2010-06-02 12:29:50 +08:00
|
|
|
|
|
|
|
namespace Test1 {
|
|
|
|
|
|
|
|
struct A { };
|
|
|
|
struct B { };
|
|
|
|
|
|
|
|
// CHECK: @_ZN5Test11fEMNS_1BEFvvENS_1AES3_
|
|
|
|
void f(void (B::*)(), A, A) { }
|
|
|
|
|
|
|
|
// CHECK: @_ZN5Test11fEMNS_1BEFvvENS_1AES3_MS0_FvS3_EMS3_FvvE
|
|
|
|
void f(void (B::*)(), A, A, void (B::*)(A), void (A::*)()) { }
|
|
|
|
|
|
|
|
}
|
2015-02-18 10:28:01 +08:00
|
|
|
|
|
|
|
namespace ManglePrefix {
|
|
|
|
template <typename>
|
|
|
|
struct X {
|
|
|
|
template <typename>
|
|
|
|
struct Y {
|
|
|
|
typedef int type;
|
|
|
|
typedef int type2;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
template <typename T>
|
|
|
|
typename X<T>::template Y<T>::type f(typename X<T>::template Y<T>::type2) { return 0; }
|
|
|
|
|
|
|
|
// CHECK: @_ZN12ManglePrefix1fIiEENS_1XIT_E1YIS2_E4typeENS5_5type2E
|
|
|
|
template int f<int>(int);
|
|
|
|
}
|