Skip to content

Commit 5d16133

Browse files
committed
AArch64: Fix asserting on unexpected triples
1 parent 617af3c commit 5d16133

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ static MCAsmInfo *createAArch64MCAsmInfo(const MCRegisterInfo &MRI,
356356
else if (TheTriple.isOSBinFormatCOFF())
357357
MAI = new AArch64MCAsmInfoGNUCOFF();
358358
else
359-
llvm_unreachable("Invalid target"); // FIXME: This is not unreachable
359+
reportFatalUsageError("unsupported object format");
360360

361361
// Initial state of the frame pointer is SP.
362362
unsigned Reg = MRI.getDwarfRegNum(AArch64::SP, true);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
; RUN: not llc -mtriple=aarch64-pc-unknown-xcoff -filetype=null %s 2>&1 | FileCheck %s
2+
; RUN: not llc -mtriple=aarch64-pc-unknown-goff -filetype=null %s 2>&1 | FileCheck %s
3+
4+
; Make sure there is no crash or assert with unexpected object
5+
; formats.
6+
7+
; CHECK: LLVM ERROR: unsupported object format
8+
define void @foo() {
9+
ret void
10+
}

0 commit comments

Comments
 (0)