diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-04 21:11:30 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-04 21:11:30 +0000 |
commit | b4051e7047a0085f0679257386ff183aed3e5162 (patch) | |
tree | 86be0a99d548864e167603673e692a5a38dfa50a /test/CodeGenCXX/mangle-template.cpp | |
parent | 465a8998bd5e2565ed98e1179876ef9266581f74 (diff) |
Implement C++11 [temp.arg.nontype]'s permission to use the address of an object
or function with internal linkage as a non-type template argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154053 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/mangle-template.cpp')
-rw-r--r-- | test/CodeGenCXX/mangle-template.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGenCXX/mangle-template.cpp b/test/CodeGenCXX/mangle-template.cpp index 1eb6a451c1..05c3a5851e 100644 --- a/test/CodeGenCXX/mangle-template.cpp +++ b/test/CodeGenCXX/mangle-template.cpp @@ -153,3 +153,20 @@ namespace test11 { 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>(); + } +} |