Skip to content

Commit a78d014

Browse files
authored
Improve error message on unsupported type usage. (#513)
1 parent f0655bd commit a78d014

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/validation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ function check_ir_values(mod::LLVM.Module, T_bad::LLVMType)
312312
for fun in functions(mod), bb in blocks(fun), inst in instructions(bb)
313313
if value_type(inst) == T_bad || any(param->value_type(param) == T_bad, operands(inst))
314314
bt = backtrace(inst)
315-
push!(errors, ("unsupported use of $(string(T_bad)) value", bt, inst))
315+
push!(errors, ("use of $(string(T_bad)) value", bt, inst))
316316
end
317317
end
318318

test/spirv_tests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ end
5454
@test_throws_message(InvalidIRError,
5555
SPIRV.code_llvm(devnull, kernel, Tuple{Ptr{Float16}, Float16};
5656
supports_fp16=false, validate=true)) do msg
57-
occursin("unsupported unsupported use of half value", msg) &&
57+
occursin("unsupported use of half value", msg) &&
5858
occursin("[1] unsafe_store!", msg) &&
5959
occursin(r"\[2\] .*kernel", msg)
6060
end
6161

6262
@test_throws_message(InvalidIRError,
6363
SPIRV.code_llvm(devnull, kernel, Tuple{Ptr{Float64}, Float64};
6464
supports_fp64=false, validate=true)) do msg
65-
occursin("unsupported unsupported use of double value", msg) &&
65+
occursin("unsupported use of double value", msg) &&
6666
occursin("[1] unsafe_store!", msg) &&
6767
occursin(r"\[2\] .*kernel", msg)
6868
end

0 commit comments

Comments
 (0)