summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/mangle-template.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/mangle-template.cpp')
-rw-r--r--test/CodeGenCXX/mangle-template.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/CodeGenCXX/mangle-template.cpp b/test/CodeGenCXX/mangle-template.cpp
index f95e152..05c3a58 100644
--- a/test/CodeGenCXX/mangle-template.cpp
+++ b/test/CodeGenCXX/mangle-template.cpp
@@ -144,3 +144,29 @@ namespace test10 {
f(i, d);
}
}
+
+// Report from Jason Merrill on cxx-abi-dev, 2012.01.04.
+namespace test11 {
+ int cmp(char a, char b);
+ template <typename T, int (*cmp)(T, T)> struct A {};
+ template <typename T> void f(A<T,cmp> &) {}
+ template void f<char>(A<char,cmp> &);
+ // CHECK: @_ZN6test111fIcEEvRNS_1AIT_L_ZNS_3cmpEccEEE(
+}
+
+namespace test12 {
+ // Make sure we can mangle non-type template args with internal linkage.
+ static int f();
+ const int n = 10;
+ template<typename T, T v> void test() {}
+ void use() {
+ // CHECK: define internal void @_ZN6test124testIFivEXadL_ZNS_L1fEvEEEEvv(
+ test<int(), &f>();
+ // CHECK: define internal void @_ZN6test124testIRFivEXadL_ZNS_L1fEvEEEEvv(
+ test<int(&)(), f>();
+ // CHECK: define internal void @_ZN6test124testIPKiXadL_ZNS_L1nEEEEEvv(
+ test<const int*, &n>();
+ // CHECK: define internal void @_ZN6test124testIRKiXadL_ZNS_L1nEEEEEvv(
+ test<const int&, n>();
+ }
+}
OpenPOWER on IntegriCloud