diff --git a/src/typeutils/jltypes.jl b/src/typeutils/jltypes.jl index 4c1b322eb9..4b88ca1e00 100644 --- a/src/typeutils/jltypes.jl +++ b/src/typeutils/jltypes.jl @@ -63,7 +63,9 @@ function classify_arguments( # - boxed values # XXX: use `deserves_retbox` instead? elseif llvm_source_typ isa LLVM.PointerType - @assert llvm_source_typ == codegen_typ + if llvm_source_typ != codegen_typ + throw(AssertionError("Mismatch codegen type llvm_source_typ=$(string(llvm_source_typ)) codegen_typ=$(string(codegen_typ)) source_i=$source_i source_sig=$source_sig, source_typ=$source_typ, codegen_i=$codegen_i, codegen_types=$(string(codegen_ft))")) + end push!( args, ( diff --git a/test/runtests.jl b/test/runtests.jl index c9cde02c28..9c09fe05e7 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -806,8 +806,13 @@ end @test autodiff(Forward, f28, Duplicated(2.0, 1.0))[1] == 12 f29(x) = sum(Set([1.0, x, 2x, x])) - @test autodiff(Reverse, f29, Active, Active(2.0))[1][1] == 3 - @test autodiff(Forward, f29, Duplicated(2.0, 1.0))[1] == 3 + @static if VERSION ≥ v"1.11-" + @test autodiff(set_runtime_activity(Reverse), f29, Active, Active(2.0))[1][1] == 3 + @test autodiff(set_runtime_activity(Forward), f29, Duplicated(2.0, 1.0))[1] == 3 + else + @test autodiff(Reverse, f29, Active, Active(2.0))[1][1] == 3 + @test autodiff(Forward, f29, Duplicated(2.0, 1.0))[1] == 3 + end f30(x) = reverse([x 2.0 3x])[1] @test autodiff(Reverse, f30, Active, Active(2.0))[1][1] == 3