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 | 0094eb26fcfc90d07a41112ba1d1f38a80896194 (patch) | |
tree | 26ba5778653b8ba018492cdb4f12a6f7a4b06633 /clang/test/CodeGenCXX/mangle-subst-std.cpp | |
parent | 87209bb54bbad2741ef63f3bacb3ac499a010633 (diff) | |
download | bcm5719-llvm-0094eb26fcfc90d07a41112ba1d1f38a80896194.tar.gz bcm5719-llvm-0094eb26fcfc90d07a41112ba1d1f38a80896194.zip |
Be sure to use the standard substitutions when mangling the names of
vtables, VTTs, and construction vtables. Fixes PR7201.
llvm-svn: 104675
Diffstat (limited to 'clang/test/CodeGenCXX/mangle-subst-std.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/mangle-subst-std.cpp | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/clang/test/CodeGenCXX/mangle-subst-std.cpp b/clang/test/CodeGenCXX/mangle-subst-std.cpp index 062610bd74a..4c15eaac883 100644 --- a/clang/test/CodeGenCXX/mangle-subst-std.cpp +++ b/clang/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); +} |