From: Jonas Devlieghere Date: Sat, 31 Oct 2020 05:07:33 +0000 (-0700) Subject: [lldb] Fix XcodeSDKModuleTests X-Git-Tag: llvmorg-13-init~7513 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=136d06749b91f5051485983a2d4de82c31d25975;p=platform%2Fupstream%2Fllvm.git [lldb] Fix XcodeSDKModuleTests Update XcodeSDKModuleTests for YAMLModuleTester changes in D90393. --- diff --git a/lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp b/lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp index 0bd0e3c..287143a 100644 --- a/lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp +++ b/lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp @@ -35,38 +35,44 @@ class XcodeSDKModuleTests : public testing::Test { TEST_F(XcodeSDKModuleTests, TestModuleGetXcodeSDK) { const char *yamldata = R"( -debug_str: - - MacOSX10.9.sdk -debug_abbrev: - - Table: - - Code: 0x00000001 - Tag: DW_TAG_compile_unit - Children: DW_CHILDREN_no - Attributes: - - Attribute: DW_AT_language - Form: DW_FORM_data2 - - Attribute: DW_AT_APPLE_sdk - Form: DW_FORM_strp -debug_info: - - Version: 2 - AddrSize: 8 - Entries: - - AbbrCode: 0x00000001 - Values: - - Value: 0x000000000000000C - - Value: 0x0000000000000000 - - AbbrCode: 0x00000000 +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_386 +DWARF: + debug_str: + - MacOSX10.9.sdk + debug_abbrev: + - Table: + - Code: 0x00000001 + Tag: DW_TAG_compile_unit + Children: DW_CHILDREN_no + Attributes: + - Attribute: DW_AT_language + Form: DW_FORM_data2 + - Attribute: DW_AT_APPLE_sdk + Form: DW_FORM_strp + debug_info: + - Version: 2 + AddrSize: 8 + Entries: + - AbbrCode: 0x00000001 + Values: + - Value: 0x000000000000000C + - Value: 0x0000000000000000 + - AbbrCode: 0x00000000 ... )"; - auto triple = "x86_64-apple-macosx"; - YAMLModuleTester t(yamldata, triple); - auto dwarf_unit_sp = t.GetDwarfUnit(); - auto *dwarf_cu = llvm::cast(dwarf_unit_sp.get()); - ASSERT_TRUE((bool)dwarf_cu); + YAMLModuleTester t(yamldata); + DWARFUnit *dwarf_unit = t.GetDwarfUnit(); + auto *dwarf_cu = llvm::cast(dwarf_unit); + ASSERT_TRUE(static_cast(dwarf_cu)); SymbolFileDWARF &sym_file = dwarf_cu->GetSymbolFileDWARF(); CompUnitSP comp_unit = sym_file.GetCompileUnitAtIndex(0); - ASSERT_TRUE((bool)comp_unit.get()); + ASSERT_TRUE(static_cast(comp_unit.get())); ModuleSP module = t.GetModule(); ASSERT_EQ(module->GetSourceMappingList().GetSize(), 0u); XcodeSDK sdk = sym_file.ParseXcodeSDK(*comp_unit);