738738@testset " postponed relocation" begin
739739 if VERSION >= v " 1.12"
740740 mod = @eval module $ (gensym ())
741- f (x :: Symbol ) = x === :host_ref_probe
741+ f () = UInt ( pointer_from_objref ( :host_ref_probe ))
742742 end
743- job, _ = Native. create_job (mod. f, (Symbol,) ; relocatable= true )
743+ job, _ = Native. create_job (mod. f, Tuple{} ; relocatable= true )
744744 JuliaContext () do ctx
745745 obj, meta = GPUCompiler. compile (:obj , job)
746746 refs = meta. host_references
@@ -751,11 +751,12 @@ end
751751
752752 bytes = Vector {UInt8} (codeunits (obj))
753753 entry = LLVM. name (meta. entry)
754+ expected = GPUCompiler. resolve_host_reference (only (values (refs. slots)))
754755 fptr, keepalive = Native. load (bytes, entry, refs)
755756 try
756757 GC. @preserve keepalive begin
757- @test ccall (fptr, Bool , (Any,), :host_ref_probe )
758- @test ! ccall (fptr, Bool, (Any,), :other )
758+ actual = ccall (fptr, UInt , () )
759+ @test actual == expected
759760 end
760761 finally
761762 dispose (first (keepalive))
0 commit comments