From: Anders Carlsson Date: Mon, 21 Dec 2009 00:57:38 +0000 (+0000) Subject: Add tests for structs inside anonymous namespaces. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=610b0d94d71810773378be4f39922a56b1202a83;p=clang Add tests for structs inside anonymous namespaces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91806 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGenCXX/rtti-linkage.cpp b/test/CodeGenCXX/rtti-linkage.cpp index 2875e19ae3..53209ed96c 100644 --- a/test/CodeGenCXX/rtti-linkage.cpp +++ b/test/CodeGenCXX/rtti-linkage.cpp @@ -24,6 +24,11 @@ // CHECK: _ZTSM1AP1C = internal constant // CHECK: _ZTIM1AP1C = internal constant +// CHECK: _ZTSN12_GLOBAL__N_11DE = internal constant +// CHECK: _ZTIN12_GLOBAL__N_11DE = internal constant +// CHECK: _ZTSPN12_GLOBAL__N_11DE = internal constant +// CHECK: _ZTIPN12_GLOBAL__N_11DE = internal constant + // A has no key function, so its RTTI data should be weak_odr. struct A { }; @@ -38,7 +43,7 @@ void B::f() { } // internal linkage, as should the type info for C itself (FIXME). struct C; -void f() { +void t1() { (void)typeid(C*); (void)typeid(C**); (void)typeid(int C::*); @@ -47,6 +52,16 @@ void f() { (void)typeid(C *C::*); (void)typeid(C A::*); (void)typeid(C* A::*); - } +namespace { + // D is inside an anonymous namespace, so all type information related to D should have + // internal linkage. + struct D { }; +}; + +void t2() { + (void)typeid(D); + (void)typeid(D *); + +}