Skip to content

Commit dfca4c2

Browse files
committed
wip
1 parent 0ecb747 commit dfca4c2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/compiler/AbstractInterpreter.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,23 @@ inner52938(x, types::Type, args...; kwargs...) = x
201201
outer52938(x) = @inline inner52938(x, Tuple{}; foo=Ref(42), bar=1)
202202
@test fully_eliminated(outer52938, (Any,); interp=Issue52938Interp(), retval=Argument(2))
203203

204+
# https://github.com/JuliaGPU/CUDA.jl/issues/2241
205+
@newinterp Cuda2241Interp
206+
@MethodTable CUDA_2241_MT
207+
CC.method_table(interp::Cuda2241Interp) = CC.OverlayMethodTable(CC.get_inference_world(interp), CUDA_2241_MT)
208+
inner52938(f, types::Type, args...; kwargs...) = nothing
209+
function outer52938(f)
210+
@inline inner52938(f, Tuple{}; foo=Ref(42), bar=1)
211+
return nothing
212+
end
213+
# NOTE CUDA.jl overlays `throw_boundserror` in a way that causes effects, but these effects
214+
# are ignored for this call graph at the `@assume_effects` annotation on `typejoin`.
215+
# Here it's important to use `@consistent_overlay` to avoid tainting the `:nonoverlayed` bit.
216+
const cuda_kernel_state = Ref{Any}()
217+
@consistent_overlay CUDA_2241_MT @inline Base.throw_boundserror(A, I) =
218+
(cuda_kernel_state[] = (A, I); error())
219+
@test fully_eliminated(outer52938, (Nothing,); interp=Cuda2241Interp(), retval=Argument(2))
220+
204221
# Should not concrete-eval overlayed methods in semi-concrete interpretation
205222
@newinterp OverlaySinInterp
206223
@MethodTable OVERLAY_SIN_MT

0 commit comments

Comments
 (0)