diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-07-12 04:47:20 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-07-12 04:47:20 +0000 |
commit | 6ef06cc48debc9f0881f3439cfc4ac722fc42879 (patch) | |
tree | 19095b8d2512e209d715b58ab13f61780f47fe1b /clang/test/CodeGenCXX/mangle.cpp | |
parent | bb1952cfda252895802eee602769add78a3f779d (diff) | |
download | bcm5719-llvm-6ef06cc48debc9f0881f3439cfc4ac722fc42879.tar.gz bcm5719-llvm-6ef06cc48debc9f0881f3439cfc4ac722fc42879.zip |
Implement the Itanium C++ ABI's mangling rule for
non-instantiation-dependent sizeof and alignof expressions.
llvm-svn: 134963
Diffstat (limited to 'clang/test/CodeGenCXX/mangle.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/mangle.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/mangle.cpp b/clang/test/CodeGenCXX/mangle.cpp index 8f1c682bb06..56e70a2b151 100644 --- a/clang/test/CodeGenCXX/mangle.cpp +++ b/clang/test/CodeGenCXX/mangle.cpp @@ -804,9 +804,25 @@ namespace test33 { } namespace test34 { + // Mangling for instantiation-dependent decltype expressions. template<typename T> void f(decltype(sizeof(decltype(T() + T())))) {} // CHECK: define weak_odr void @_ZN6test341fIiEEvDTstDTplcvT__EcvS1__EEE template void f<int>(decltype(sizeof(1))); + + // Mangling for non-instantiation-dependent sizeof expressions. + template<unsigned N> + void f2(int (&)[N + sizeof(int*)]) {} + + // CHECK: define weak_odr void @_ZN6test342f2ILj4EEEvRAplT_Lm8E_i + template void f2<4>(int (&)[4 + sizeof(int*)]); + + // Mangling for non-instantiation-dependent sizeof expressions + // involving an implicit conversion of the result of the sizeof. + template<unsigned long long N> + void f3(int (&)[N + sizeof(int*)]) {} + + // CHECK: define weak_odr void @_ZN6test342f3ILy4EEEvRAplT_Ly8E_i + template void f3<4>(int (&)[4 + sizeof(int*)]); } |