diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
| commit | dbe13110f59f48b4dbb7552b3ac2935acdeece7f (patch) | |
| tree | be1815eb79b42ff482a8562b13c2dcbf0c5dcbee /test/CodeGenCXX/mangle-template.cpp | |
| parent | 9da628931ebf2609493570f87824ca22402cc65f (diff) | |
Notes
Diffstat (limited to 'test/CodeGenCXX/mangle-template.cpp')
| -rw-r--r-- | test/CodeGenCXX/mangle-template.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/CodeGenCXX/mangle-template.cpp b/test/CodeGenCXX/mangle-template.cpp index f95e1521549d..05c3a5851e4a 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>(); + } +} |
