[llvm] dfe9bb4 - [ELF] Attempt to fix test on big endian architectures
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 5 09:24:09 PST 2024
Author: Joseph Huber
Date: 2024-01-05T11:24:03-06:00
New Revision: dfe9bb4dc22796073b677984f2ffa5580003ce82
URL: https://github.com/llvm/llvm-project/commit/dfe9bb4dc22796073b677984f2ffa5580003ce82
DIFF: https://github.com/llvm/llvm-project/commit/dfe9bb4dc22796073b677984f2ffa5580003ce82.diff
LOG: [ELF] Attempt to fix test on big endian architectures
Summary:
This test fails because AMDGPU has a check for little-endianness before
returning the architecture. This test attempts to force the type to be
considered little-endian for the purpose of this test.
Added:
Modified:
llvm/unittests/Object/ELFObjectFileTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/Object/ELFObjectFileTest.cpp b/llvm/unittests/Object/ELFObjectFileTest.cpp
index e7619ded494edb..ccf52ae48e925f 100644
--- a/llvm/unittests/Object/ELFObjectFileTest.cpp
+++ b/llvm/unittests/Object/ELFObjectFileTest.cpp
@@ -305,12 +305,11 @@ TEST(ELFObjectFileTest, CheckOSAndTriple) {
for (auto [Machine, OS, Triple] : Formats) {
const DataForTest D(ELF::ELFCLASS64, ELF::ELFDATA2LSB, Machine, OS,
ELF::EF_AMDGPU_MACH_AMDGCN_LAST);
- Expected<std::unique_ptr<ObjectFile>> ELFObjOrErr =
- object::ObjectFile::createELFObjectFile(
- MemoryBufferRef(toStringRef(D.Data), "dummyELF"));
+ Expected<ELF64LEObjectFile> ELFObjOrErr = ELF64LEObjectFile::create(
+ MemoryBufferRef(toStringRef(D.Data), "dummyELF"));
ASSERT_THAT_EXPECTED(ELFObjOrErr, Succeeded());
- auto &ELFObj = **ELFObjOrErr;
+ auto &ELFObj = *ELFObjOrErr;
EXPECT_EQ(Triple, ELFObj.makeTriple().getTriple());
}
}
More information about the llvm-commits
mailing list