-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move target triple check before translation
Check that the target triple is supported before LLVM to SPIR-V translation, rather than during translation. This allows us to gracefully report InvalidTargetTriple instead of failing the target triple assertion in PreprocessMetadata.cpp.
- Loading branch information
Showing
2 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
; RUN: llvm-as %s -o %t.bc | ||
; RUN: not --crash llvm-spirv %t.bc -o %t.spv 2>&1 | FileCheck %s | ||
|
||
; CHECK: InvalidTargetTriple: Expects spir-unknown-unknown or spir64-unknown-unknown. Actual target triple is aarch64 | ||
|
||
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
target triple = "aarch64" | ||
|
||
; Function Attrs: convergent noinline nounwind optnone | ||
define spir_func void @_Z3foov() { | ||
entry: | ||
ret void | ||
} | ||
|
||
!llvm.module.flags = !{!0} | ||
!opencl.spir.version = !{!1} | ||
!opencl.ocl.version = !{!1} | ||
|
||
!0 = !{i32 1, !"wchar_size", i32 4} | ||
!1 = !{i32 2, i32 0} |