Skip to content

Commit 8940960

Browse files
committed
MC: Use reportFatalUsageError for COFF with non-windows
1 parent fd894f6 commit 8940960

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

llvm/lib/MC/MCContext.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,10 @@ MCContext::MCContext(const Triple &TheTriple, const MCAsmInfo *mai,
8787
Env = IsMachO;
8888
break;
8989
case Triple::COFF:
90-
if (!TheTriple.isOSWindows() && !TheTriple.isUEFI())
91-
report_fatal_error(
92-
"Cannot initialize MC for non-Windows COFF object files.");
90+
if (!TheTriple.isOSWindows() && !TheTriple.isUEFI()) {
91+
reportFatalUsageError(
92+
"cannot initialize MC for non-Windows COFF object files");
93+
}
9394

9495
Env = IsCOFF;
9596
break;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
; RUN: not llc -mtriple=aarch64-unknown-linux-coff -filetype=null %s 2>&1 | FileCheck %s
2+
; CHECK: LLVM ERROR: cannot initialize MC for non-Windows COFF object files
3+
define void @foo() {
4+
ret void
5+
}

0 commit comments

Comments
 (0)