Skip to content

Commit 31085d4

Browse files
committed
AMDGPU: Use reportFatalUsageError for unsupported code object version
1 parent cbd4965 commit 31085d4

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ bool AMDGPUAsmPrinter::doInitialization(Module &M) {
350350
HSAMetadataStream = std::make_unique<HSAMD::MetadataStreamerMsgPackV6>();
351351
break;
352352
default:
353-
report_fatal_error("Unexpected code object version");
353+
reportFatalUsageError("unsupported code object version");
354354
}
355355
}
356356

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
; RUN: not llc -filetype=asm -mtriple=amdgcn-amd-amdhsa -mcpu=gfx801 -o /dev/null %s 2>&1 | FileCheck %s
2+
; RUN: not llc -filetype=obj -mtriple=amdgcn-amd-amdhsa -mcpu=gfx801 -o /dev/null %s 2>&1 | FileCheck %s
3+
; RUN: not llc -filetype=null -mtriple=amdgcn-amd-amdhsa -mcpu=gfx801 -o /dev/null %s 2>&1 | FileCheck %s
4+
5+
; CHECK: LLVM ERROR: unsupported code object version
6+
define amdgpu_kernel void @kernel() {
7+
ret void
8+
}
9+
10+
!llvm.module.flags = !{!0}
11+
12+
!0 = !{i32 1, !"amdhsa_code_object_version", i32 0}

0 commit comments

Comments
 (0)