]> granicus.if.org Git - clang/commitdiff
Add base class checks.
authorAnders Carlsson <andersca@mac.com>
Wed, 30 Dec 2009 01:29:05 +0000 (01:29 +0000)
committerAnders Carlsson <andersca@mac.com>
Wed, 30 Dec 2009 01:29:05 +0000 (01:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92286 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGenCXX/rtti-layout.cpp

index 5f9cdab8f526e3e3cf254a3890d9418f2eca5e6b..6b3b26747ffe37d4f175e0729a3f23367ffaacbb 100644 (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);