//===-- extensible_rtti_test.cpp ------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file is a part of the ORC runtime. // // Note: // This unit test was adapted from // llvm/unittests/Support/ExtensibleRTTITest.cpp // //===----------------------------------------------------------------------===// #include "extensible_rtti.h" #include "gtest/gtest.h" using namespace __orc_rt; namespace { class MyBase : public RTTIExtends {}; class MyDerivedA : public RTTIExtends {}; class MyDerivedB : public RTTIExtends {}; } // end anonymous namespace TEST(ExtensibleRTTITest, BaseCheck) { MyBase MB; MyDerivedA MDA; MyDerivedB MDB; // Check MB properties. EXPECT_TRUE(isa(MB)); EXPECT_TRUE(isa(MB)); EXPECT_FALSE(isa(MB)); EXPECT_FALSE(isa(MB)); // Check MDA properties. EXPECT_TRUE(isa(MDA)); EXPECT_TRUE(isa(MDA)); EXPECT_TRUE(isa(MDA)); EXPECT_FALSE(isa(MDA)); // Check MDB properties. EXPECT_TRUE(isa(MDB)); EXPECT_TRUE(isa(MDB)); EXPECT_FALSE(isa(MDB)); EXPECT_TRUE(isa(MDB)); }