[cfe-commits] r92286 - /cfe/trunk/test/CodeGenCXX/rtti-layout.cpp
Anders Carlsson
andersca at mac.com
Tue Dec 29 17:29:05 PST 2009
Author: andersca
Date: Tue Dec 29 19:29:05 2009
New Revision: 92286
URL: http://llvm.org/viewvc/llvm-project?rev=92286&view=rev
Log:
Add base class checks.
Modified:
cfe/trunk/test/CodeGenCXX/rtti-layout.cpp
Modified: cfe/trunk/test/CodeGenCXX/rtti-layout.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/rtti-layout.cpp?rev=92286&r1=92285&r2=92286&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/rtti-layout.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/rtti-layout.cpp Tue Dec 29 19:29:05 2009
@@ -31,6 +31,13 @@
};
};
+class __class_type_info : public std::type_info { };
+
+class __si_class_type_info : public __class_type_info {
+public:
+ const __class_type_info *__base_type;
+};
+
template<typename T> const T& to(const std::type_info &info) {
return static_cast<const T&>(info);
}
@@ -82,6 +89,10 @@
// VMI4 has two bases.
CHECK_VTABLE(VMI4, vmi_class);
+ CHECK(to<__si_class_type_info>(typeid(SI1)).__base_type == &typeid(A));
+ CHECK(to<__si_class_type_info>(typeid(SI2)).__base_type == &typeid(Empty));
+ CHECK(to<__si_class_type_info>(typeid(SI3)).__base_type == &typeid(Empty));
+
// Pointers to incomplete classes.
CHECK_VTABLE(Incomplete *, pointer);
CHECK(to<__pbase_type_info>(typeid(Incomplete *)).__flags == __pbase_type_info::__incomplete_mask);
More information about the cfe-commits
mailing list