diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp --- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp @@ -36,10 +36,13 @@ EXPECT_FALSE(Unrecoverable); } + Triple getGeneratorTriple(uint8_t AddrSize = 8) { + return getDefaultTargetTripleForAddrSize(AddrSize == 0 ? 8 : AddrSize); + } + bool setupGenerator(uint16_t Version = 4, uint8_t AddrSize = 8) { AddressSize = AddrSize; - Triple T = - getDefaultTargetTripleForAddrSize(AddressSize == 0 ? 8 : AddressSize); + Triple T = getGeneratorTriple(AddressSize); if (!isConfigurationSupported(T)) return false; auto ExpectedGenerator = Generator::create(T, Version); @@ -1443,11 +1446,11 @@ void SetUp() { std::tie(BodyLength, OpcodeLength, Opcode, Operands, ExpectedOutput, ExpectedErr) = GetParam(); - // Swap the byte order of the operands on big endian hosts, so that the raw - // bytes are always in the same order. ValLen.Value is a uint64_t, so make - // sure to shift the value back to the actually used bits for the + // Swap the byte order of the operands on big endian targets, so that the + // raw bytes are always in the same order. ValLen.Value is a uint64_t, so + // make sure to shift the value back to the actually used bits for the // appropriate type. - if (sys::IsBigEndianHost) + if (!getGeneratorTriple().isLittleEndian()) for (LineTable::ValueAndLength &ValLen : Operands) if (ValLen.Length != LineTable::SLEB && ValLen.Length != LineTable::ULEB &&