Add base class checks.

llvm-svn: 92286
This commit is contained in:
Anders Carlsson 2009-12-30 01:29:05 +00:00
parent a4bbe58c3b
commit 1e4cd33f13
1 changed files with 11 additions and 0 deletions

View File

@ -31,6 +31,13 @@ public:
};
};
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 @@ int f() {
// 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);