diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2004-07-08 04:58:11 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2004-07-07 21:58:11 -0700 |
commit | 7ac224c1e4eda9a386d693888d2e130941482fe8 (patch) | |
tree | 2c69628abc2ab9c2049b842867d8ba207ad7ebba | |
parent | 89b578be68dd3d91e551c3ba922f054ead36c4e4 (diff) | |
download | gcc-7ac224c1e4eda9a386d693888d2e130941482fe8.zip gcc-7ac224c1e4eda9a386d693888d2e130941482fe8.tar.gz gcc-7ac224c1e4eda9a386d693888d2e130941482fe8.tar.bz2 |
re PR c++/16276 ([3.4 only] G++ generates local references to linkonce sections)
2004-07-07 H.J. Lu <hongjiu.lu@intel.com>
PR c++/16276
* g++.dg/rtti/tinfo1.C: New file.
From-SVN: r84261
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/rtti/tinfo1.C | 40 |
2 files changed, 45 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b5d6d37..244498e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-07-07 H.J. Lu <hongjiu.lu@intel.com> + + PR c++/16276 + * g++.dg/rtti/tinfo1.C: New file. + 2004-07-07 Eric Christopher <echristo@redhat.com> * gcc.c-torture/compile/20020210-1.c: xfail with optimization. diff --git a/gcc/testsuite/g++.dg/rtti/tinfo1.C b/gcc/testsuite/g++.dg/rtti/tinfo1.C new file mode 100644 index 0000000..f359d16 --- /dev/null +++ b/gcc/testsuite/g++.dg/rtti/tinfo1.C @@ -0,0 +1,40 @@ +// Test if a local definition is in a linkonce/comdat section. +// { dg-do compile } +// { dg-final { scan-assembler "_ZTIP9CTemplateIhE:" } } +// { dg-final { scan-assembler-not ".globl\[ \]+_ZTIP9CTemplateIhE" } } +// { dg-final { scan-assembler-not ".section\[^\n\r\]*_ZTIP9CTemplateIhE\[^\n\r\]*" } } + + +namespace std +{ + class type_info + { + protected: + const char *__name; + + protected: + explicit type_info(const char *__n): __name(__n) { } + + public: + const char* name() const + { return __name; } + }; +} + +template<class TYPE> +class CTemplate +{ +}; + +class CSecondModule { +public: + CSecondModule(); + +private: + const CTemplate<unsigned char> *m_variable; typedef CTemplate<unsigned char> m_variable_type; +}; + +CSecondModule::CSecondModule() +{ + typeid(const_cast<m_variable_type *>(m_variable)).name() != 0; +} |