Skip to content

Commit

Permalink
Fix vtable + transitive di th tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianbs96 committed Apr 21, 2024
1 parent 7d3641c commit f630ebe
Showing 1 changed file with 65 additions and 65 deletions.
130 changes: 65 additions & 65 deletions unittests/PhasarLLVM/TypeHierarchy/DIBasedTypeHierarchyTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,19 +819,19 @@ TEST(DBTHTest, VTableConstruction_7) {
DIBasedTypeHierarchy DBTH(IRDB);

// check for all types
const auto &AType = DBTH.getType("A");
const auto &AType = DBTH.getType("_ZTS1A");
ASSERT_NE(nullptr, AType);
const auto &BType = DBTH.getType("B");
const auto &BType = DBTH.getType("_ZTS1B");
ASSERT_NE(nullptr, BType);
const auto &CType = DBTH.getType("C");
const auto &CType = DBTH.getType("_ZTS1C");
ASSERT_NE(nullptr, CType);
const auto &DType = DBTH.getType("D");
const auto &DType = DBTH.getType("_ZTS1D");
ASSERT_NE(nullptr, DType);
const auto &XType = DBTH.getType("X");
const auto &XType = DBTH.getType("_ZTS1X");
ASSERT_NE(nullptr, XType);
const auto &YType = DBTH.getType("Y");
const auto &YType = DBTH.getType("_ZTS1Y");
ASSERT_NE(nullptr, YType);
const auto &ZType = DBTH.getType("Z");
const auto &ZType = DBTH.getType("_ZTS1Z");
ASSERT_NE(nullptr, ZType);

const auto &VTableForAType = DBTH.getVFTable(AType);
Expand Down Expand Up @@ -865,13 +865,13 @@ TEST(DBTHTest, VTableConstruction_7_b) {
DIBasedTypeHierarchy DBTH(IRDB);

// check for all types
const auto &AType = DBTH.getType("_ZTS1A");
const auto &AType = DBTH.getType("A");
ASSERT_NE(nullptr, AType);
const auto &CType = DBTH.getType("_ZTS1C");
ASSERT_NE(nullptr, CType);
const auto &XType = DBTH.getType("_ZTS1X");
const auto &XType = DBTH.getType("X");
ASSERT_NE(nullptr, XType);
const auto &YType = DBTH.getType("vY");
const auto &YType = DBTH.getType("_ZTS1Y");
ASSERT_NE(nullptr, YType);
const auto &ZType = DBTH.getType("_ZTS1Z");
ASSERT_NE(nullptr, ZType);
Expand Down Expand Up @@ -911,9 +911,9 @@ TEST(DBTHTest, VTableConstruction_8) {
ASSERT_NE(nullptr, BaseType);
const auto &ChildType = DBTH.getType("_ZTS5Child");
ASSERT_NE(nullptr, ChildType);
const auto &NonvirtualClassType = DBTH.getType("NonvirtualClass");
const auto &NonvirtualClassType = DBTH.getType("_ZTS15NonvirtualClass");
EXPECT_NE(nullptr, NonvirtualClassType);
const auto &NonvirtualStructType = DBTH.getType("NonvirtualStruct");
const auto &NonvirtualStructType = DBTH.getType("_ZTS16NonvirtualStruct");
EXPECT_NE(nullptr, NonvirtualStructType);

const auto &VTableForBaseType = DBTH.getVFTable(BaseType);
Expand Down Expand Up @@ -1042,9 +1042,9 @@ TEST(DBTHTest, VTableConstruction_12_b) {
DIBasedTypeHierarchy DBTH(IRDB);

// check for all types
const auto &BaseType = DBTH.getType("_ZTS4Base");
const auto &BaseType = DBTH.getType("Base");
ASSERT_NE(nullptr, BaseType);
const auto &ChildType = DBTH.getType("_ZTS5Child");
const auto &ChildType = DBTH.getType("Child");
ASSERT_NE(nullptr, ChildType);
const auto &ChildsChildType = DBTH.getType("_ZTS11ChildsChild");
ASSERT_NE(nullptr, ChildsChildType);
Expand All @@ -1070,7 +1070,7 @@ TEST(DBTHTest, VTableConstruction_12_c) {
DIBasedTypeHierarchy DBTH(IRDB);

// check for all types
const auto &ChildType = DBTH.getType("_ZTS5Child");
const auto &ChildType = DBTH.getType("Child");
ASSERT_NE(nullptr, ChildType);
const auto &ChildsChildType = DBTH.getType("_ZTS11ChildsChild");
ASSERT_NE(nullptr, ChildsChildType);
Expand Down Expand Up @@ -1137,11 +1137,11 @@ TEST(DBTHTest, VTableConstruction_16) {
ASSERT_NE(nullptr, BaseType);
const auto &ChildType = DBTH.getType("_ZTS5Child");
ASSERT_NE(nullptr, ChildType);
const auto &ChildOfChildType = DBTH.getType("ChildOfChild");
const auto &ChildOfChildType = DBTH.getType("_ZTS12ChildOfChild");
ASSERT_NE(nullptr, ChildOfChildType);
const auto &BaseTwoType = DBTH.getType("BaseTwo");
const auto &BaseTwoType = DBTH.getType("_ZTS7BaseTwo");
ASSERT_NE(nullptr, BaseTwoType);
const auto &ChildTwoType = DBTH.getType("ChildTwo");
const auto &ChildTwoType = DBTH.getType("_ZTS8ChildTwo");
ASSERT_NE(nullptr, ChildTwoType);

const auto &VTableForBase = DBTH.getVFTable(BaseType);
Expand Down Expand Up @@ -1184,9 +1184,9 @@ TEST(DBTHTest, VTableConstruction_17) {
// Since Child2 is never used, it is sometimes optimized out by the compiler
// const auto &Child2Type = DBTH.getType("Child2");
// ASSERT_NE(nullptr, Child2Type);
const auto &Base2Type = DBTH.getType("Base2");
const auto &Base2Type = DBTH.getType("_ZTS5Base2");
ASSERT_NE(nullptr, Base2Type);
const auto &KidType = DBTH.getType("Kid");
const auto &KidType = DBTH.getType("_ZTS3Kid");
ASSERT_NE(nullptr, KidType);

const auto &VTableForBase = DBTH.getVFTable(BaseType);
Expand Down Expand Up @@ -1233,9 +1233,9 @@ TEST(DBTHTest, VTableConstruction_18) {
ASSERT_NE(nullptr, BaseType);
const auto &ChildType = DBTH.getType("_ZTS5Child");
ASSERT_NE(nullptr, ChildType);
const auto &Child2Type = DBTH.getType("Child_2");
const auto &Child2Type = DBTH.getType("_ZTS7Child_2");
ASSERT_NE(nullptr, Child2Type);
const auto &Child3Type = DBTH.getType("Child_3");
const auto &Child3Type = DBTH.getType("_ZTS7Child_3");
ASSERT_NE(nullptr, Child3Type);

const auto &VTableForBase = DBTH.getVFTable(BaseType);
Expand Down Expand Up @@ -1276,13 +1276,13 @@ TEST(DBTHTest, VTableConstruction_19) {
ASSERT_NE(nullptr, BaseType);
const auto &ChildType = DBTH.getType("_ZTS5Child");
ASSERT_NE(nullptr, ChildType);
const auto &FooType = DBTH.getType("Foo");
const auto &FooType = DBTH.getType("_ZTS3Foo");
ASSERT_NE(nullptr, FooType);
const auto &BarType = DBTH.getType("Bar");
const auto &BarType = DBTH.getType("_ZTS3Bar");
ASSERT_NE(nullptr, BarType);
const auto &LoremType = DBTH.getType("Lorem");
const auto &LoremType = DBTH.getType("_ZTS5Lorem");
ASSERT_NE(nullptr, LoremType);
const auto &ImpsumType = DBTH.getType("Impsum");
const auto &ImpsumType = DBTH.getType("_ZTS6Impsum");
ASSERT_NE(nullptr, ImpsumType);

const auto &VTableForBase = DBTH.getVFTable(BaseType);
Expand Down Expand Up @@ -1327,7 +1327,7 @@ TEST(DBTHTest, VTableConstruction_20) {
// check for all types
const auto &BaseType = DBTH.getType("_ZTS4Base");
ASSERT_NE(nullptr, BaseType);
const auto &Base2Type = DBTH.getType("Base2");
const auto &Base2Type = DBTH.getType("_ZTS5Base2");
ASSERT_NE(nullptr, Base2Type);
const auto &ChildType = DBTH.getType("_ZTS5Child");
ASSERT_NE(nullptr, ChildType);
Expand Down Expand Up @@ -1360,13 +1360,13 @@ TEST(DBTHTest, VTableConstruction_21) {
// check for all types
const auto &BaseType = DBTH.getType("_ZTS4Base");
ASSERT_NE(nullptr, BaseType);
const auto &Base2Type = DBTH.getType("Base2");
const auto &Base2Type = DBTH.getType("_ZTS5Base2");
ASSERT_NE(nullptr, Base2Type);
const auto &Base3Type = DBTH.getType("Base3");
const auto &Base3Type = DBTH.getType("_ZTS5Base3");
ASSERT_NE(nullptr, Base3Type);
const auto &ChildType = DBTH.getType("_ZTS5Child");
ASSERT_NE(nullptr, ChildType);
const auto &Child2Type = DBTH.getType("Child2");
const auto &Child2Type = DBTH.getType("_ZTS6Child2");
ASSERT_NE(nullptr, Child2Type);

const auto &VTableForBase = DBTH.getVFTable(BaseType);
Expand Down Expand Up @@ -1559,19 +1559,19 @@ TEST(DBTHTest, TransitivelyReachableTypes_7) {
DIBasedTypeHierarchy DBTH(IRDB);

// check for all types
const auto &AType = DBTH.getType("A");
const auto &AType = DBTH.getType("_ZTS1A");
ASSERT_NE(nullptr, AType);
const auto &BType = DBTH.getType("B");
const auto &BType = DBTH.getType("_ZTS1B");
ASSERT_NE(nullptr, BType);
const auto &CType = DBTH.getType("C");
const auto &CType = DBTH.getType("_ZTS1C");
ASSERT_NE(nullptr, CType);
const auto &DType = DBTH.getType("D");
const auto &DType = DBTH.getType("_ZTS1D");
ASSERT_NE(nullptr, DType);
const auto &XType = DBTH.getType("X");
const auto &XType = DBTH.getType("_ZTS1X");
ASSERT_NE(nullptr, XType);
const auto &YType = DBTH.getType("Y");
const auto &YType = DBTH.getType("_ZTS1Y");
ASSERT_NE(nullptr, YType);
const auto &ZType = DBTH.getType("Z");
const auto &ZType = DBTH.getType("_ZTS1Z");
ASSERT_NE(nullptr, ZType);

auto ReachableTypesA = DBTH.getSubTypes(AType);
Expand Down Expand Up @@ -1655,15 +1655,15 @@ TEST(DBTHTest, TransitivelyReachableTypes_7_b) {
// check for all types
const auto &AType = DBTH.getType("A");
ASSERT_NE(nullptr, AType);
const auto &CType = DBTH.getType("C");
const auto &CType = DBTH.getType("_ZTS1C");
ASSERT_NE(nullptr, CType);
const auto &XType = DBTH.getType("X");
ASSERT_NE(nullptr, XType);
const auto &YType = DBTH.getType("Y");
const auto &YType = DBTH.getType("_ZTS1Y");
ASSERT_NE(nullptr, YType);
const auto &ZType = DBTH.getType("Z");
const auto &ZType = DBTH.getType("_ZTS1Z");
ASSERT_NE(nullptr, ZType);
const auto &OmegaType = DBTH.getType("Omega");
const auto &OmegaType = DBTH.getType("_ZTS5Omega");
ASSERT_NE(nullptr, OmegaType);

auto ReachableTypesA = DBTH.getSubTypes(AType);
Expand Down Expand Up @@ -1733,9 +1733,9 @@ TEST(DBTHTest, TransitivelyReachableTypes_8) {
ASSERT_NE(nullptr, BaseType);
const auto &ChildType = DBTH.getType("_ZTS5Child");
ASSERT_NE(nullptr, ChildType);
const auto &NonvirtualClassType = DBTH.getType("NonvirtualClass");
const auto &NonvirtualClassType = DBTH.getType("_ZTS15NonvirtualClass");
ASSERT_NE(nullptr, NonvirtualClassType);
const auto &NonvirtualStructType = DBTH.getType("NonvirtualStruct");
const auto &NonvirtualStructType = DBTH.getType("_ZTS16NonvirtualStruct");
ASSERT_NE(nullptr, NonvirtualStructType);

auto ReachableTypesBase = DBTH.getSubTypes(BaseType);
Expand Down Expand Up @@ -1863,11 +1863,11 @@ TEST(DBTHTest, TransitivelyReachableTypes_12_b) {
DIBasedTypeHierarchy DBTH(IRDB);

// check for all types
const auto &BaseType = DBTH.getType("_ZTS4Base");
const auto &BaseType = DBTH.getType("Base");
ASSERT_NE(nullptr, BaseType);
const auto &ChildType = DBTH.getType("_ZTS5Child");
const auto &ChildType = DBTH.getType("Child");
ASSERT_NE(nullptr, ChildType);
const auto &ChildsChildType = DBTH.getType("ChildsChild");
const auto &ChildsChildType = DBTH.getType("_ZTS11ChildsChild");
ASSERT_NE(nullptr, ChildsChildType);

auto ReachableTypesBase = DBTH.getSubTypes(BaseType);
Expand All @@ -1894,9 +1894,9 @@ TEST(DBTHTest, TransitivelyReachableTypes_12_c) {
DIBasedTypeHierarchy DBTH(IRDB);

// check for all types
const auto &ChildType = DBTH.getType("_ZTS5Child");
const auto &ChildType = DBTH.getType("Child");
ASSERT_NE(nullptr, ChildType);
const auto &ChildsChildType = DBTH.getType("ChildsChild");
const auto &ChildsChildType = DBTH.getType("_ZTS11ChildsChild");
ASSERT_NE(nullptr, ChildsChildType);

auto ReachableTypesChild = DBTH.getSubTypes(ChildType);
Expand All @@ -1922,7 +1922,7 @@ TEST(DBTHTest, TransitivelyReachableTypes_14) {
DIBasedTypeHierarchy DBTH(IRDB);

// check for all types
const auto &BaseType = DBTH.getType("_ZTS4Base");
const auto &BaseType = DBTH.getType("Base");
ASSERT_NE(nullptr, BaseType);

auto ReachableTypesBase = DBTH.getSubTypes(BaseType);
Expand All @@ -1937,9 +1937,9 @@ TEST(DBTHTest, TransitivelyReachableTypes_15) {
DIBasedTypeHierarchy DBTH(IRDB);

// check for all types
const auto &BaseType = DBTH.getType("_ZTS4Base");
const auto &BaseType = DBTH.getType("Base");
ASSERT_NE(nullptr, BaseType);
const auto &ChildType = DBTH.getType("_ZTS5Child");
const auto &ChildType = DBTH.getType("Child");
ASSERT_NE(nullptr, ChildType);

auto ReachableTypesBase = DBTH.getSubTypes(BaseType);
Expand All @@ -1966,9 +1966,9 @@ TEST(DBTHTest, TransitivelyReachableTypes_16) {
// const auto &ChildsChildType = DBTH.getType("ChildsChild");
// Since ChildsChild is never used, it is optimized out
// ASSERT_EQ(nullptr, ChildsChildType);
const auto &BaseTwoType = DBTH.getType("BaseTwo");
const auto &BaseTwoType = DBTH.getType("_ZTS7BaseTwo");
ASSERT_NE(nullptr, BaseTwoType);
const auto &ChildTwoType = DBTH.getType("ChildTwo");
const auto &ChildTwoType = DBTH.getType("_ZTS8ChildTwo");
ASSERT_NE(nullptr, ChildTwoType);

auto ReachableTypesBase = DBTH.getSubTypes(BaseType);
Expand Down Expand Up @@ -2011,9 +2011,9 @@ TEST(DBTHTest, TransitivelyReachableTypes_17) {
// const auto &Child2Type = DBTH.getType("Child2");
// Since Child2 is never used, it is optimized out
// ASSERT_EQ(nullptr, Child2Type);
const auto &Base2Type = DBTH.getType("Base2");
const auto &Base2Type = DBTH.getType("_ZTS5Base2");
ASSERT_NE(nullptr, Base2Type);
const auto &KidType = DBTH.getType("Kid");
const auto &KidType = DBTH.getType("_ZTS3Kid");
ASSERT_NE(nullptr, KidType);

auto ReachableTypesBase = DBTH.getSubTypes(BaseType);
Expand Down Expand Up @@ -2053,9 +2053,9 @@ TEST(DBTHTest, TransitivelyReachableTypes_18) {
ASSERT_NE(nullptr, BaseType);
const auto &ChildType = DBTH.getType("_ZTS5Child");
ASSERT_NE(nullptr, ChildType);
const auto &Child2Type = DBTH.getType("Child_2");
const auto &Child2Type = DBTH.getType("_ZTS7Child_2");
ASSERT_NE(nullptr, Child2Type);
const auto &Child3Type = DBTH.getType("Child_3");
const auto &Child3Type = DBTH.getType("_ZTS7Child_3");
ASSERT_NE(nullptr, Child3Type);

auto ReachableTypesBase = DBTH.getSubTypes(BaseType);
Expand Down Expand Up @@ -2091,13 +2091,13 @@ TEST(DBTHTest, TransitivelyReachableTypes_19) {
ASSERT_NE(nullptr, BaseType);
const auto &ChildType = DBTH.getType("_ZTS5Child");
ASSERT_NE(nullptr, ChildType);
const auto &FooType = DBTH.getType("Foo");
const auto &FooType = DBTH.getType("_ZTS3Foo");
ASSERT_NE(nullptr, FooType);
const auto &BarType = DBTH.getType("Bar");
const auto &BarType = DBTH.getType("_ZTS3Bar");
ASSERT_NE(nullptr, BarType);
const auto &LoremType = DBTH.getType("Lorem");
const auto &LoremType = DBTH.getType("_ZTS5Lorem");
ASSERT_NE(nullptr, LoremType);
const auto &ImpsumType = DBTH.getType("Impsum");
const auto &ImpsumType = DBTH.getType("_ZTS6Impsum");
ASSERT_NE(nullptr, ImpsumType);

auto ReachableTypesBase = DBTH.getSubTypes(BaseType);
Expand Down Expand Up @@ -2138,7 +2138,7 @@ TEST(DBTHTest, TransitivelyReachableTypes_20) {
// check for all types
const auto &BaseType = DBTH.getType("_ZTS4Base");
ASSERT_NE(nullptr, BaseType);
const auto &Base2Type = DBTH.getType("Base2");
const auto &Base2Type = DBTH.getType("_ZTS5Base2");
ASSERT_NE(nullptr, Base2Type);
const auto &ChildType = DBTH.getType("_ZTS5Child");
ASSERT_NE(nullptr, ChildType);
Expand Down Expand Up @@ -2168,13 +2168,13 @@ TEST(DBTHTest, TransitivelyReachableTypes_21) {
// check for all types
const auto &BaseType = DBTH.getType("_ZTS4Base");
ASSERT_NE(nullptr, BaseType);
const auto &Base2Type = DBTH.getType("Base2");
const auto &Base2Type = DBTH.getType("_ZTS5Base2");
ASSERT_NE(nullptr, Base2Type);
const auto &Base3Type = DBTH.getType("Base3");
const auto &Base3Type = DBTH.getType("_ZTS5Base3");
ASSERT_NE(nullptr, Base3Type);
const auto &ChildType = DBTH.getType("_ZTS5Child");
ASSERT_NE(nullptr, ChildType);
const auto &Child2Type = DBTH.getType("Child2");
const auto &Child2Type = DBTH.getType("_ZTS6Child2");
ASSERT_NE(nullptr, Child2Type);

auto ReachableTypesBase = DBTH.getSubTypes(BaseType);
Expand Down

0 comments on commit f630ebe

Please sign in to comment.