summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Huber <huberjn@outlook.com>2024-01-05 11:44:22 -0600
committerJoseph Huber <huberjn@outlook.com>2024-01-05 11:49:21 -0600
commitc2f5e435a561cb0ebd3334a1377ebbefe8dcf5c3 (patch)
tree216084d06b4e4189de127e262f561b85562c4521
parent0e8b09c43d9f9e68c95fa1e6f6fb5c8307f3927d (diff)
[ELF] Again attempt to fix test on BE architectures
Summary: This formats something according to the style, and again attempts to fix this failing on the BE PPC test. Sorry for the spam, these commits are the only way I can check it because the failure isn't local.
-rw-r--r--llvm/include/llvm/Object/ELFObjectFile.h3
-rw-r--r--llvm/unittests/Object/ELFObjectFileTest.cpp8
2 files changed, 8 insertions, 3 deletions
diff --git a/llvm/include/llvm/Object/ELFObjectFile.h b/llvm/include/llvm/Object/ELFObjectFile.h
index da72b0e335b9..86f42654f8af 100644
--- a/llvm/include/llvm/Object/ELFObjectFile.h
+++ b/llvm/include/llvm/Object/ELFObjectFile.h
@@ -1353,8 +1353,7 @@ template <class ELFT> Triple::ArchType ELFObjectFile<ELFT>::getArch() const {
case ELF::EM_CUDA: {
if (EF.getHeader().e_ident[ELF::EI_CLASS] == ELF::ELFCLASS32)
return Triple::nvptx;
- else
- return Triple::nvptx64;
+ return Triple::nvptx64;
}
case ELF::EM_BPF:
diff --git a/llvm/unittests/Object/ELFObjectFileTest.cpp b/llvm/unittests/Object/ELFObjectFileTest.cpp
index ccf52ae48e92..71c08f51f863 100644
--- a/llvm/unittests/Object/ELFObjectFileTest.cpp
+++ b/llvm/unittests/Object/ELFObjectFileTest.cpp
@@ -310,7 +310,13 @@ TEST(ELFObjectFileTest, CheckOSAndTriple) {
ASSERT_THAT_EXPECTED(ELFObjOrErr, Succeeded());
auto &ELFObj = *ELFObjOrErr;
- EXPECT_EQ(Triple, ELFObj.makeTriple().getTriple());
+ llvm::Triple TheTriple = ELFObj.makeTriple();
+
+ // The AMDGPU architecture will be unknown on big-endian testers.
+ if (TheTriple.getOS() == Triple::UnknownOS)
+ continue;
+
+ EXPECT_EQ(Triple, TheTriple.getTriple());
}
}