Skip to content

Commit 2a53722

Browse files
maleadtKristofferC
authored andcommitted
Fixes for bitcast bugs with LLVM 17 / opaque pointers (#54548)
Skip setName on folded inputs, and ensure the correct pointer address space is used. (cherry picked from commit baca8ba)
1 parent c96d507 commit 2a53722

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/intrinsics.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,3 +361,16 @@ Base.show(io::IO, a::IntWrap) = print(io, "IntWrap(", a.x, ")")
361361
@test r2 isa IntWrap && r2.x === 103 === r[].x && r2 !== r[]
362362
end
363363
end)()
364+
365+
@testset "issue #54548" begin
366+
@inline passthrough(ptr::Core.LLVMPtr{T,A}) where {T,A} = Base.llvmcall(("""
367+
define ptr addrspace(1) @entry(ptr addrspace(1) %0) #0 {
368+
entry:
369+
ret ptr addrspace(1) %0
370+
}
371+
372+
attributes #0 = { alwaysinline }""", "entry"),
373+
Core.LLVMPtr{T,A}, Tuple{Core.LLVMPtr{T,A}}, ptr)
374+
f(gws) = passthrough(Core.bitcast(Core.LLVMPtr{UInt32,1}, gws))
375+
f(C_NULL)
376+
end

0 commit comments

Comments
 (0)