[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / mangle-subst.cpp
blob20f33a72fff83026e381aae667d1f4b3103f8cea
1 // RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 | FileCheck %s
3 struct X {};
5 // CHECK-LABEL: define{{.*}} void @_Z1f1XS_(
6 void f(X, X) { }
8 // CHECK-LABEL: define{{.*}} void @_Z1fR1XS0_(
9 void f(X&, X&) { }
11 // CHECK-LABEL: define{{.*}} void @_Z1fRK1XS1_(
12 void f(const X&, const X&) { }
14 typedef void T();
15 struct S {};
17 // CHECK-LABEL: define{{.*}} void @_Z1fPFvvEM1SFvvE(
18 void f(T*, T (S::*)) {}
20 namespace A {
21 struct A { };
22 struct B { };
25 // CHECK-LABEL: define{{.*}} void @_Z1fN1A1AENS_1BE(
26 void f(A::A a, A::B b) { }
28 struct C {
29 struct D { };
32 // CHECK-LABEL: define{{.*}} void @_Z1fN1C1DERS_PS_S1_(
33 void f(C::D, C&, C*, C&) { }
35 template<typename T>
36 struct V {
37 typedef int U;
40 template <typename T> void f1(typename V<T>::U, V<T>) { }
42 // CHECK: @_Z2f1IiEvN1VIT_E1UES2_
43 template void f1<int>(int, V<int>);
45 template <typename T> void f2(V<T>, typename V<T>::U) { }
47 // CHECK: @_Z2f2IiEv1VIT_ENS2_1UE
48 template void f2<int>(V<int>, int);
50 namespace NS {
51 template <typename T> struct S1 {};
52 template<typename T> void ft3(S1<T>, S1<char>) { }
54 // CHECK: @_ZN2NS3ft3IiEEvNS_2S1IT_EENS1_IcEE
55 template void ft3<int>(S1<int>, S1<char>);
58 // PR5196
59 // CHECK: @_Z1fPKcS0_
60 void f(const char*, const char*) {}
62 namespace NS {
63 class C;
66 namespace NS {
67 // CHECK: @_ZN2NS1fERNS_1CE
68 void f(C&) { }
71 namespace Test1 {
73 struct A { };
74 struct B { };
76 // CHECK: @_ZN5Test11fEMNS_1BEFvvENS_1AES3_
77 void f(void (B::*)(), A, A) { }
79 // CHECK: @_ZN5Test11fEMNS_1BEFvvENS_1AES3_MS0_FvS3_EMS3_FvvE
80 void f(void (B::*)(), A, A, void (B::*)(A), void (A::*)()) { }
84 namespace ManglePrefix {
85 template <typename>
86 struct X {
87 template <typename>
88 struct Y {
89 typedef int type;
90 typedef int type2;
93 template <typename T>
94 typename X<T>::template Y<T>::type f(typename X<T>::template Y<T>::type2) { return 0; }
96 // CHECK: @_ZN12ManglePrefix1fIiEENS_1XIT_E1YIS2_E4typeENS5_5type2E
97 template int f<int>(int);