diff options
author | Joseph Huber <huberjn@outlook.com> | 2024-01-05 11:23:10 -0600 |
---|---|---|
committer | Joseph Huber <huberjn@outlook.com> | 2024-01-05 11:24:03 -0600 |
commit | dfe9bb4dc22796073b677984f2ffa5580003ce82 (patch) | |
tree | 595dd84dbb1999a5f102ab0ab5a7af4507598fba /llvm/unittests | |
parent | 4dd5d967975fa8d52b8c60596d892d9dd5615809 (diff) | |
download | llvm-dfe9bb4dc22796073b677984f2ffa5580003ce82.zip llvm-dfe9bb4dc22796073b677984f2ffa5580003ce82.tar.gz llvm-dfe9bb4dc22796073b677984f2ffa5580003ce82.tar.bz2 |
[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.
Diffstat (limited to 'llvm/unittests')
-rw-r--r-- | llvm/unittests/Object/ELFObjectFileTest.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/unittests/Object/ELFObjectFileTest.cpp b/llvm/unittests/Object/ELFObjectFileTest.cpp index e7619de..ccf52ae 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()); } } |