diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-05-26 05:11:13 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-05-26 05:11:13 +0000 |
commit | 1b12a3bb4d4c0db74fc97be724beefec7366b460 (patch) | |
tree | b6521401d47cee173b874228d2a365edd8cc06ba /test/CodeGenCXX/mangle-subst-std.cpp | |
parent | 400b06dde52df439b25264fbbc0271d96d27903c (diff) |
Be sure to use the standard substitutions when mangling the names of
vtables, VTTs, and construction vtables. Fixes PR7201.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104675 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/mangle-subst-std.cpp')
-rw-r--r-- | test/CodeGenCXX/mangle-subst-std.cpp | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/test/CodeGenCXX/mangle-subst-std.cpp b/test/CodeGenCXX/mangle-subst-std.cpp index 062610bd74..4c15eaac88 100644 --- a/test/CodeGenCXX/mangle-subst-std.cpp +++ b/test/CodeGenCXX/mangle-subst-std.cpp @@ -1,5 +1,16 @@ // RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 | FileCheck %s +// Check mangling of Vtables, VTTs, and construction vtables that +// involve standard substitutions. + +// CHECK: @_ZTVSd = weak_odr constant +// CHECK: @_ZTCSd0_Si = internal constant +// CHECK: @_ZTCSd16_So = internal constant +// CHECK: @_ZTTSd = weak_odr constant +// CHECK: @_ZTVSo = weak_odr constant +// CHECK: @_ZTTSo = weak_odr constant +// CHECK: @_ZTVSi = weak_odr constant +// CHECK: @_ZTTSi = weak_odr constant namespace std { struct A { A(); }; @@ -32,9 +43,30 @@ namespace std { void f(std::string) { } namespace std { - template<typename, typename> struct basic_istream { }; - template<typename, typename> struct basic_ostream { }; - template<typename, typename> struct basic_iostream { }; + template<typename, typename> struct basic_ios { + basic_ios(int); + virtual ~basic_ios(); + }; + template<typename charT, typename traits = char_traits<charT> > + struct basic_istream : virtual public basic_ios<charT, traits> { + basic_istream(int x) : basic_ios<charT, traits>(x), stored(x) { } + + int stored; + }; + template<typename charT, typename traits = char_traits<charT> > + struct basic_ostream : virtual public basic_ios<charT, traits> { + basic_ostream(int x) : basic_ios<charT, traits>(x), stored(x) { } + + float stored; + }; + + template<typename charT, typename traits = char_traits<charT> > + struct basic_iostream : public basic_istream<charT, traits>, + public basic_ostream<charT, traits> { + basic_iostream(int x) : basic_istream<charT, traits>(x), + basic_ostream<charT, traits>(x), + basic_ios<charT, traits>(x) { } + }; } // CHECK: _Z1fSi @@ -61,3 +93,9 @@ namespace std template<typename, typename, typename> struct basic_string { }; typedef basic_string<char, std::char_traits<char>, std::allocator<char> > not_string; void f(not_string) { } + +// Manglings for instantiations caused by this function are at the +// top of the test. +void create_streams() { + std::basic_iostream<char> bio(17); +} |