summaryrefslogtreecommitdiff
path: root/clang/test/CodeGenCXX/mangle-subst.cpp
diff options
context:
space:
mode:
authorZancanaro; Carlo <czan8762@plang3.cs.usyd.edu.au>2012-09-24 09:58:17 +1000
committerZancanaro; Carlo <czan8762@plang3.cs.usyd.edu.au>2012-09-24 09:58:17 +1000
commit222e2a7620e6520ffaf4fc4e69d79c18da31542e (patch)
tree7bfbc05bfa3b41c8f9d2e56d53a0bc3e310df239 /clang/test/CodeGenCXX/mangle-subst.cpp
parent3d206f03985b50beacae843d880bccdc91a9f424 (diff)
Add the clang library to the repo (with some of my changes, too).
Diffstat (limited to 'clang/test/CodeGenCXX/mangle-subst.cpp')
-rw-r--r--clang/test/CodeGenCXX/mangle-subst.cpp82
1 files changed, 82 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/mangle-subst.cpp b/clang/test/CodeGenCXX/mangle-subst.cpp
new file mode 100644
index 0000000..d83a081
--- /dev/null
+++ b/clang/test/CodeGenCXX/mangle-subst.cpp
@@ -0,0 +1,82 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 | FileCheck %s
+
+struct X {};
+
+// CHECK: define void @_Z1f1XS_(
+void f(X, X) { }
+
+// CHECK: define void @_Z1fR1XS0_(
+void f(X&, X&) { }
+
+// CHECK: define void @_Z1fRK1XS1_(
+void f(const X&, const X&) { }
+
+typedef void T();
+struct S {};
+
+// CHECK: define void @_Z1fPFvvEM1SFvvE(
+void f(T*, T (S::*)) {}
+
+namespace A {
+ struct A { };
+ struct B { };
+};
+
+// CHECK: define void @_Z1fN1A1AENS_1BE(
+void f(A::A a, A::B b) { }
+
+struct C {
+ struct D { };
+};
+
+// CHECK: define void @_Z1fN1C1DERS_PS_S1_(
+void f(C::D, C&, C*, C&) { }
+
+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);
+
+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>);
+}
+
+// PR5196
+// CHECK: @_Z1fPKcS0_
+void f(const char*, const char*) {}
+
+namespace NS {
+ class C;
+}
+
+namespace NS {
+ // CHECK: @_ZN2NS1fERNS_1CE
+ void f(C&) { }
+}
+
+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::*)()) { }
+
+}