Skip to content

Commit c2f5e43

Browse files
committed
[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.
1 parent 0e8b09c commit c2f5e43

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

llvm/include/llvm/Object/ELFObjectFile.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,8 +1353,7 @@ template <class ELFT> Triple::ArchType ELFObjectFile<ELFT>::getArch() const {
13531353
case ELF::EM_CUDA: {
13541354
if (EF.getHeader().e_ident[ELF::EI_CLASS] == ELF::ELFCLASS32)
13551355
return Triple::nvptx;
1356-
else
1357-
return Triple::nvptx64;
1356+
return Triple::nvptx64;
13581357
}
13591358

13601359
case ELF::EM_BPF:

llvm/unittests/Object/ELFObjectFileTest.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,13 @@ TEST(ELFObjectFileTest, CheckOSAndTriple) {
310310
ASSERT_THAT_EXPECTED(ELFObjOrErr, Succeeded());
311311

312312
auto &ELFObj = *ELFObjOrErr;
313-
EXPECT_EQ(Triple, ELFObj.makeTriple().getTriple());
313+
llvm::Triple TheTriple = ELFObj.makeTriple();
314+
315+
// The AMDGPU architecture will be unknown on big-endian testers.
316+
if (TheTriple.getOS() == Triple::UnknownOS)
317+
continue;
318+
319+
EXPECT_EQ(Triple, TheTriple.getTriple());
314320
}
315321
}
316322

0 commit comments

Comments
 (0)