From 056abd2059c65a3e908193aeae16fad98017437c Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 2 Dec 2012 13:20:44 +0000 Subject: Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2): http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974 --- test/CodeGenCXX/mangle-ms-template-callback.cpp | 72 +++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 test/CodeGenCXX/mangle-ms-template-callback.cpp (limited to 'test/CodeGenCXX/mangle-ms-template-callback.cpp') diff --git a/test/CodeGenCXX/mangle-ms-template-callback.cpp b/test/CodeGenCXX/mangle-ms-template-callback.cpp new file mode 100644 index 0000000..6878148 --- /dev/null +++ b/test/CodeGenCXX/mangle-ms-template-callback.cpp @@ -0,0 +1,72 @@ +// RUN: %clang_cc1 -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s + +template +class C; + +template +class C {}; +typedef C C0; + +template +class C {}; + +template +class C {}; + +C0 callback_void; +// CHECK: "\01?callback_void@@3V?$C@$$A6AXXZ@@A" + +volatile C0 callback_void_volatile; +// CHECK: "\01?callback_void_volatile@@3V?$C@$$A6AXXZ@@C" + +class Type {}; + +C callback_int; +// CHECK: "\01?callback_int@@3V?$C@$$A6AHXZ@@A" +C callback_Type; +// CHECK: "\01?callback_Type@@3V?$C@$$A6A?AVType@@XZ@@A" + +C callback_void_int; +// CHECK: "\01?callback_void_int@@3V?$C@$$A6AXH@Z@@A" +C callback_int_int; +// CHECK: "\01?callback_int_int@@3V?$C@$$A6AHH@Z@@A" +C callback_void_Type; +// CHECK: "\01?callback_void_Type@@3V?$C@$$A6AXVType@@@Z@@A" + +void foo(C0 c) {} +// CHECK: "\01?foo@@YAXV?$C@$$A6AXXZ@@@Z" + +// Here be dragons! +// Let's face the magic of template partial specialization... + +void function(C) {} +// CHECK: "\01?function@@YAXV?$C@$$A6AXXZ@@@Z" + +template class C {}; +void function_pointer(C) {} +// CHECK: "\01?function_pointer@@YAXV?$C@P6AXXZ@@@Z" + +// Block equivalent to the previous definitions. +template class C {}; +void block(C) {} +// CHECK: "\01?block@@YAXV?$C@P_EAXXZ@@@Z" +// FYI blocks are not present in MSVS, so we're free to choose the spec. + +template class C {}; +class Z { + public: + void method() {} +}; +void member_pointer(C) {} +// CHECK: "\01?member_pointer@@YAXV?$C@P8Z@@AEXXZ@@@Z" + +template void bar(T) {} + +void call_bar() { + bar(0); +// CHECK: "\01??$bar@P6AHH@Z@@YAXP6AHH@Z@Z" + + bar(0); +// CHECK: "\01??$bar@P_EAHH@Z@@YAXP_EAHH@Z@Z" +// FYI blocks are not present in MSVS, so we're free to choose the spec. +} -- cgit v1.1