From 4345adc0016f811f3bef964977019db3755bae4d Mon Sep 17 00:00:00 2001 From: N5N3 <2642243996@qq.com> Date: Sat, 3 Dec 2022 20:44:06 +0800 Subject: [PATCH] Fix `@test_inlined` on nightly see --- test/testutil.jl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/testutil.jl b/test/testutil.jl index e92055be..f3faad7c 100644 --- a/test/testutil.jl +++ b/test/testutil.jl @@ -55,8 +55,17 @@ macro test_inlined(ex, should_inline=true) ex_orig = ex ex = macroexpand(@__MODULE__, :(@code_llvm $ex)) expr = quote - code_str = sprint() do io - code_llvm(io, $(map(esc, ex.args[2:end])...)) + @static if hasfield(Base.CodegenParams, :safepoint_on_entry) + code_str = let params = Base.CodegenParams(safepoint_on_entry=false), + f = $(esc(ex.args[2])), + t = $(esc(ex.args[3])) + d = InteractiveUtils._dump_function(f, t, false, false, true, false, :att, true, :none, false, params) + sprint(print, d) + end + else + code_str = sprint() do io + code_llvm(io, $(map(esc, ex.args[2:end])...)) + end end # Crude detection of call instructions remaining within what should be # fully inlined code.