Skip to content

Commit dfd38df

Browse files
aviateskoscarddssmith
authored andcommitted
add more test case for inference with overlayed method table (JuliaLang#48988)
1 parent c3ec23c commit dfd38df

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/compiler/AbstractInterpreter.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@ Base.@assume_effects :total totalcall(f, args...) = f(args...)
107107
end
108108
end |> only === Nothing
109109

110+
# GPUCompiler needs accurate inference through kwfunc with the overlay of `Core.throw_inexacterror`
111+
# https://github.com/JuliaLang/julia/issues/48097
112+
@newinterp Issue48097Interp
113+
@MethodTable Issue48097MT
114+
CC.method_table(interp::Issue48097Interp) = CC.OverlayMethodTable(CC.get_world_counter(interp), Issue48097MT)
115+
@overlay Issue48097MT @noinline Core.throw_inexacterror(f::Symbol, ::Type{T}, val) where {T} = return
116+
issue48097(; kwargs...) = return 42
117+
@test fully_eliminated(; interp=Issue48097Interp(), retval=42) do
118+
issue48097(; a=1f0, b=1.0)
119+
end
120+
110121
# AbstractLattice
111122
# ===============
112123

0 commit comments

Comments
 (0)