From 554bcb69c2d785a011a30e7db87a36a87fe7db10 Mon Sep 17 00:00:00 2001 From: dim Date: Wed, 15 Aug 2012 20:02:54 +0000 Subject: Vendor import of clang trunk r161861: http://llvm.org/svn/llvm-project/cfe/trunk@161861 --- test/CodeGenCXX/mangle-ms-templates.cpp | 68 +++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 test/CodeGenCXX/mangle-ms-templates.cpp (limited to 'test/CodeGenCXX/mangle-ms-templates.cpp') diff --git a/test/CodeGenCXX/mangle-ms-templates.cpp b/test/CodeGenCXX/mangle-ms-templates.cpp new file mode 100644 index 0000000..977ef35 --- /dev/null +++ b/test/CodeGenCXX/mangle-ms-templates.cpp @@ -0,0 +1,68 @@ +// RUN: %clang_cc1 -fms-extensions -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s + +template +class Class { + public: + void method() {} +}; + +class Typename { }; + +template +class Nested { }; + +template +class BoolTemplate { + public: + BoolTemplate() {} +}; + +template +class IntTemplate { + public: + IntTemplate() {} +}; + +template<> +class BoolTemplate { + public: + BoolTemplate() {} + template void Foo(T arg) {} +}; + +void template_mangling() { + Class c1; + c1.method(); +// CHECK: call {{.*}} @"\01?method@?$Class@VTypename@@@@QAEXXZ" + + Class > c2; + c2.method(); +// CHECK: call {{.*}} @"\01?method@?$Class@V?$Nested@VTypename@@@@@@QAEXXZ" + + BoolTemplate _false; +// CHECK: call {{.*}} @"\01??0?$BoolTemplate@$0A@@@QAE@XZ" + + BoolTemplate _true; + // PR13158 + _true.Foo(1); +// CHECK: call {{.*}} @"\01??0?$BoolTemplate@$00@@QAE@XZ" +// CHECK: call {{.*}} @"\01??$Foo@H@?$BoolTemplate@$00@@QAEXH@Z" + + IntTemplate<5> five; +// CHECK: call {{.*}} @"\01??0?$IntTemplate@$04@@QAE@XZ" + + IntTemplate<11> eleven; +// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0L@@@QAE@XZ" + + IntTemplate<65535> ffff; +// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0PPPP@@@QAE@XZ" +} + +namespace space { + template const T& foo(const T& l) { return l; } +} +// CHECK: "\01??$foo@H@space@@YAABHABH@Z" + +void use() { + space::foo(42); +} -- cgit v1.1