diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index d83d0dbd8a0b9..acdfa4d4632f8 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -3430,32 +3430,32 @@ g41908() = f41908(Any[1][1]) @test only(Base.return_types(g41908, ())) <: Int # issue #42022 -let x = Any[ - Expr(:(=), Core.SlotNumber(3), 1) - Expr(:enter, 18) - Expr(:(=), Core.SlotNumber(3), 2.0) - Expr(:enter, 12) - Expr(:(=), Core.SlotNumber(3), '3') - Core.GotoIfNot(Core.SlotNumber(2), 9) - Expr(:leave, 2) - Core.ReturnNode(1) - Expr(:call, GlobalRef(Main, :throw)) - Expr(:leave, 1) - Core.GotoNode(16) - Expr(:leave, 1) - Expr(:(=), Core.SlotNumber(4), Expr(:the_exception)) - Expr(:call, GlobalRef(Main, :rethrow)) - Expr(:pop_exception, Core.SSAValue(4)) - Expr(:leave, 1) - Core.GotoNode(22) - Expr(:leave, 1) - Expr(:(=), Core.SlotNumber(5), Expr(:the_exception)) - nothing - Expr(:pop_exception, Core.SSAValue(2)) - Core.ReturnNode(Core.SlotNumber(3)) +let x = Tuple{Int,Any}[ + #= 1=# (0, Expr(:(=), Core.SlotNumber(3), 1)) + #= 2=# (0, Expr(:enter, 18)) + #= 3=# (2, Expr(:(=), Core.SlotNumber(3), 2.0)) + #= 4=# (2, Expr(:enter, 12)) + #= 5=# (4, Expr(:(=), Core.SlotNumber(3), '3')) + #= 6=# (4, Core.GotoIfNot(Core.SlotNumber(2), 9)) + #= 7=# (4, Expr(:leave, 2)) + #= 8=# (0, Core.ReturnNode(1)) + #= 9=# (4, Expr(:call, GlobalRef(Main, :throw))) + #=10=# (4, Expr(:leave, 1)) + #=11=# (2, Core.GotoNode(16)) + #=12=# (4, Expr(:leave, 1)) + #=13=# (2, Expr(:(=), Core.SlotNumber(4), Expr(:the_exception))) + #=14=# (2, Expr(:call, GlobalRef(Main, :rethrow))) + #=15=# (2, Expr(:pop_exception, Core.SSAValue(4))) + #=16=# (2, Expr(:leave, 1)) + #=17=# (0, Core.GotoNode(22)) + #=18=# (2, Expr(:leave, 1)) + #=19=# (0, Expr(:(=), Core.SlotNumber(5), Expr(:the_exception))) + #=20=# (0, nothing) + #=21=# (0, Expr(:pop_exception, Core.SSAValue(2))) + #=22=# (0, Core.ReturnNode(Core.SlotNumber(3))) ] - handler_at = Core.Compiler.compute_trycatch(x, Core.Compiler.BitSet()) - @test handler_at == [0, 0, 2, 2, 4, 4, 4, 0, 4, 4, 2, 4, 2, 2, 2, 2, 0, 2, 0, 0, 0, 0] + handler_at = Core.Compiler.compute_trycatch(last.(x), Core.Compiler.BitSet()) + @test handler_at == first.(x) end @test only(Base.return_types((Bool,)) do y