[cfe-commits] r91806 - /cfe/trunk/test/CodeGenCXX/rtti-linkage.cpp
Anders Carlsson
andersca at mac.com
Sun Dec 20 16:57:38 PST 2009
Author: andersca
Date: Sun Dec 20 18:57:38 2009
New Revision: 91806
URL: http://llvm.org/viewvc/llvm-project?rev=91806&view=rev
Log:
Add tests for structs inside anonymous namespaces.
Modified:
cfe/trunk/test/CodeGenCXX/rtti-linkage.cpp
Modified: cfe/trunk/test/CodeGenCXX/rtti-linkage.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/rtti-linkage.cpp?rev=91806&r1=91805&r2=91806&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/rtti-linkage.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/rtti-linkage.cpp Sun Dec 20 18:57:38 2009
@@ -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 @@
// 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)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 *);
+
+}
More information about the cfe-commits
mailing list