summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp')
-rw-r--r--llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp50
1 files changed, 2 insertions, 48 deletions
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
index 004eafe0092..6b26318802a 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
@@ -67,23 +67,12 @@ void TestAllForms() {
const uint32_t Dwarf32Values[] = {1, 2, 3, 4, 5, 6, 7, 8};
const char *StringValue = "Hello";
const char *StrpValue = "World";
- const char *StrxValue = "Indexed";
- const char *Strx1Value = "Indexed1";
- const char *Strx2Value = "Indexed2";
- const char *Strx3Value = "Indexed3";
- const char *Strx4Value = "Indexed4";
auto ExpectedDG = dwarfgen::Generator::create(Triple, Version);
ASSERT_THAT_EXPECTED(ExpectedDG, Succeeded());
dwarfgen::Generator *DG = ExpectedDG.get().get();
dwarfgen::CompileUnit &CU = DG->addCompileUnit();
dwarfgen::DIE CUDie = CU.getUnitDIE();
-
- if (Version >= 5)
- CUDie.addAttribute(dwarf::DW_AT_str_offsets_base, dwarf::DW_FORM_sec_offset,
- MCSymbolRefExpr::create(DG->getStringOffsetsStartSym(),
- *DG->getMCContext()));
-
uint16_t Attr = DW_AT_lo_user;
//----------------------------------------------------------------------
@@ -133,19 +122,6 @@ void TestAllForms() {
const auto Attr_DW_FORM_string = static_cast<dwarf::Attribute>(Attr++);
CUDie.addAttribute(Attr_DW_FORM_string, DW_FORM_string, StringValue);
- const auto Attr_DW_FORM_strx = static_cast<dwarf::Attribute>(Attr++);
- const auto Attr_DW_FORM_strx1 = static_cast<dwarf::Attribute>(Attr++);
- const auto Attr_DW_FORM_strx2 = static_cast<dwarf::Attribute>(Attr++);
- const auto Attr_DW_FORM_strx3 = static_cast<dwarf::Attribute>(Attr++);
- const auto Attr_DW_FORM_strx4 = static_cast<dwarf::Attribute>(Attr++);
- if (Version >= 5) {
- CUDie.addAttribute(Attr_DW_FORM_strx, DW_FORM_strx, StrxValue);
- CUDie.addAttribute(Attr_DW_FORM_strx1, DW_FORM_strx1, Strx1Value);
- CUDie.addAttribute(Attr_DW_FORM_strx2, DW_FORM_strx2, Strx2Value);
- CUDie.addAttribute(Attr_DW_FORM_strx3, DW_FORM_strx3, Strx3Value);
- CUDie.addAttribute(Attr_DW_FORM_strx4, DW_FORM_strx4, Strx4Value);
- }
-
const auto Attr_DW_FORM_strp = static_cast<dwarf::Attribute>(Attr++);
CUDie.addAttribute(Attr_DW_FORM_strp, DW_FORM_strp, StrpValue);
@@ -305,33 +281,11 @@ void TestAllForms() {
//----------------------------------------------------------------------
auto ExtractedStringValue = toString(DieDG.find(Attr_DW_FORM_string));
EXPECT_TRUE((bool)ExtractedStringValue);
- EXPECT_STREQ(StringValue, *ExtractedStringValue);
-
- if (Version >= 5) {
- auto ExtractedStrxValue = toString(DieDG.find(Attr_DW_FORM_strx));
- EXPECT_TRUE((bool)ExtractedStrxValue);
- EXPECT_STREQ(StrxValue, *ExtractedStrxValue);
-
- auto ExtractedStrx1Value = toString(DieDG.find(Attr_DW_FORM_strx1));
- EXPECT_TRUE((bool)ExtractedStrx1Value);
- EXPECT_STREQ(Strx1Value, *ExtractedStrx1Value);
-
- auto ExtractedStrx2Value = toString(DieDG.find(Attr_DW_FORM_strx2));
- EXPECT_TRUE((bool)ExtractedStrx2Value);
- EXPECT_STREQ(Strx2Value, *ExtractedStrx2Value);
-
- auto ExtractedStrx3Value = toString(DieDG.find(Attr_DW_FORM_strx3));
- EXPECT_TRUE((bool)ExtractedStrx3Value);
- EXPECT_STREQ(Strx3Value, *ExtractedStrx3Value);
-
- auto ExtractedStrx4Value = toString(DieDG.find(Attr_DW_FORM_strx4));
- EXPECT_TRUE((bool)ExtractedStrx4Value);
- EXPECT_STREQ(Strx4Value, *ExtractedStrx4Value);
- }
+ EXPECT_TRUE(strcmp(StringValue, *ExtractedStringValue) == 0);
auto ExtractedStrpValue = toString(DieDG.find(Attr_DW_FORM_strp));
EXPECT_TRUE((bool)ExtractedStrpValue);
- EXPECT_STREQ(StrpValue, *ExtractedStrpValue);
+ EXPECT_TRUE(strcmp(StrpValue, *ExtractedStrpValue) == 0);
//----------------------------------------------------------------------
// Test reference forms
OpenPOWER on IntegriCloud