diff options
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 062610b..4c15eaa 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); +} |