[RISCV] Simplify usage of SplatPat_simm5_plus1. NFC (#125340)
[llvm-project.git] / clang / test / CodeGenCXX / mangle-subst.cpp
blob524e0febe479a8e3bfa42c25981a1d8bba11bbe5
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
4 //CHECK: @_ZTCN16MangleCtorVTable4InstE0_NS_1A4ImplINS1_4WrapEEE
5 //CHECK-CLANG-19: @_ZTCN16MangleCtorVTable4InstE0_NS_1A4ImplINS0_4WrapEEE
7 struct X {};
9 // CHECK-LABEL: define{{.*}} void @_Z1f1XS_(
10 void f(X, X) { }
12 // CHECK-LABEL: define{{.*}} void @_Z1fR1XS0_(
13 void f(X&, X&) { }
15 // CHECK-LABEL: define{{.*}} void @_Z1fRK1XS1_(
16 void f(const X&, const X&) { }
18 typedef void T();
19 struct S {};
21 // CHECK-LABEL: define{{.*}} void @_Z1fPFvvEM1SFvvE(
22 void f(T*, T (S::*)) {}
24 namespace A {
25 struct A { };
26 struct B { };
29 // CHECK-LABEL: define{{.*}} void @_Z1fN1A1AENS_1BE(
30 void f(A::A a, A::B b) { }
32 struct C {
33 struct D { };
36 // CHECK-LABEL: define{{.*}} void @_Z1fN1C1DERS_PS_S1_(
37 void f(C::D, C&, C*, C&) { }
39 template<typename T>
40 struct V {
41 typedef int U;
44 template <typename T> void f1(typename V<T>::U, V<T>) { }
46 // CHECK: @_Z2f1IiEvN1VIT_E1UES2_
47 template void f1<int>(int, V<int>);
49 template <typename T> void f2(V<T>, typename V<T>::U) { }
51 // CHECK: @_Z2f2IiEv1VIT_ENS2_1UE
52 template void f2<int>(V<int>, int);
54 namespace NS {
55 template <typename T> struct S1 {};
56 template<typename T> void ft3(S1<T>, S1<char>) { }
58 // CHECK: @_ZN2NS3ft3IiEEvNS_2S1IT_EENS1_IcEE
59 template void ft3<int>(S1<int>, S1<char>);
62 // PR5196
63 // CHECK: @_Z1fPKcS0_
64 void f(const char*, const char*) {}
66 namespace NS {
67 class C;
70 namespace NS {
71 // CHECK: @_ZN2NS1fERNS_1CE
72 void f(C&) { }
75 namespace Test1 {
77 struct A { };
78 struct B { };
80 // CHECK: @_ZN5Test11fEMNS_1BEFvvENS_1AES3_
81 void f(void (B::*)(), A, A) { }
83 // CHECK: @_ZN5Test11fEMNS_1BEFvvENS_1AES3_MS0_FvS3_EMS3_FvvE
84 void f(void (B::*)(), A, A, void (B::*)(A), void (A::*)()) { }
88 namespace ManglePrefix {
89 template <typename>
90 struct X {
91 template <typename>
92 struct Y {
93 typedef int type;
94 typedef int type2;
97 template <typename T>
98 typename X<T>::template Y<T>::type f(typename X<T>::template Y<T>::type2) { return 0; }
100 // CHECK: @_ZN12ManglePrefix1fIiEENS_1XIT_E1YIS2_E4typeENS5_5type2E
101 template int f<int>(int);
104 namespace MangleCtorVTable {
105 namespace A {
107 class VBase {
108 public:
109 virtual ~VBase() {};
112 struct Wrap {};
114 template <typename T>
115 class Impl : public virtual VBase {
116 public:
119 } // namespace A
121 struct Inst : public A::Impl<A::Wrap> {};
123 void Test() { Inst a; }