summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/mangle-ms-templates.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2013-07-02 18:10:07 +0000
committerReid Kleckner <reid@kleckner.net>2013-07-02 18:10:07 +0000
commitf0ae35b88c19ddc42673bfe8e74d77069a42c20a (patch)
tree427305da011c8a1599794495e2c158d1dec861fc /clang/test/CodeGenCXX/mangle-ms-templates.cpp
parent5001ec9190bf43ecf2ed91eac19776ea4754a721 (diff)
downloadbcm5719-llvm-f0ae35b88c19ddc42673bfe8e74d77069a42c20a.tar.gz
bcm5719-llvm-f0ae35b88c19ddc42673bfe8e74d77069a42c20a.zip
[ms-cxxabi] Mangle variadic template parameter packs
Unlike Itanium, there is no code to indicate the beginning of a parameter pack. I tested this with MSVC 2013, which is the only version that implements variadic templates so far. This is needed to compile APInt.cpp for the MS C++ ABI. Reviewers: timurrrr Differential Revision: http://llvm-reviews.chandlerc.com/D1077 llvm-svn: 185454
Diffstat (limited to 'clang/test/CodeGenCXX/mangle-ms-templates.cpp')
-rw-r--r--clang/test/CodeGenCXX/mangle-ms-templates.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/mangle-ms-templates.cpp b/clang/test/CodeGenCXX/mangle-ms-templates.cpp
index c52b6b4b7a2..363583a65f4 100644
--- a/clang/test/CodeGenCXX/mangle-ms-templates.cpp
+++ b/clang/test/CodeGenCXX/mangle-ms-templates.cpp
@@ -133,3 +133,26 @@ void spam() {
// CHECK: "\01??$FunctionPointerTemplate@$1?spam@@YAXXZ@@YAXXZ"
// X64: "\01??$FunctionPointerTemplate@$1?spam@@YAXXZ@@YAXXZ"
}
+
+// Unlike Itanium, there is no character code to indicate an argument pack.
+// Tested with MSVC 2013, the first version which supports variadic templates.
+
+template <typename ...Ts> void variadic_fn_template(const Ts &...args) { }
+void variadic_fn_instantiate() {
+ variadic_fn_template(0, 1, 3, 4);
+ variadic_fn_template(0, 1, 'a', "b");
+}
+// CHECK: "\01??$variadic_fn_template@HHHH@@YAXABH000@Z"
+// CHECK: "\01??$variadic_fn_template@HHD$$BY01D@@YAXABH0ABDAAY01$$CBD@Z"
+
+template <typename ...Ts>
+struct VariadicClass {
+ VariadicClass() { }
+ int x;
+};
+void variadic_class_instantiate() {
+ VariadicClass<int, char, bool> a;
+ VariadicClass<bool, char, int> b;
+}
+// CHECK: call {{.*}} @"\01??0?$VariadicClass@HD_N@@QAE@XZ"
+// CHECK: call {{.*}} @"\01??0?$VariadicClass@_NDH@@QAE@XZ"
OpenPOWER on IntegriCloud