Debian Codegraph @

gcc/testsuite/g++.dg/rtti/tinfo1.C

raw
1 // Test if a local definition is in a linkonce/comdat section.
2 // { dg-do compile }
3 // { dg-final { scan-assembler "_ZTIP9CTemplateIhE\[: \t\n\]" } }
4 // { dg-final { scan-assembler-not "(.globl|.global)\[ \]+_ZTIP9CTemplateIhE" } }
5 // { dg-final { scan-assembler-not ".section\[^\n\r\]*_ZTIP9CTemplateIhE\[^\n\r\]*" } }
6
7
8 namespace std
9 {
10 class type_info
11 {
12 protected:
13 const char *__name;
14
15 protected:
16 explicit type_info(const char *__n): __name(__n) { }
17
18 public:
19 const char* name() const
20 { return __name; }
21 };
22 }
23
24 template<class TYPE>
25 class CTemplate
26 {
27 };
28
29 class CSecondModule {
30 public:
31 CSecondModule();
32
33 private:
34 const CTemplate<unsigned char> *m_variable; typedef CTemplate<unsigned char> m_variable_type;
35 };
36
37 CSecondModule::CSecondModule()
38 {
39 typeid(const_cast<m_variable_type *>(m_variable)).name() != 0;
40 }