Skip to content

Commit

Permalink
Update test/compiler/inference.jl
Browse files Browse the repository at this point in the history
Co-authored-by: Shuhei Kadowaki <[email protected]>
  • Loading branch information
vtjnash and aviatesk authored Sep 2, 2021
1 parent 1dd2051 commit 2ed1741
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions test/compiler/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2ed1741

Please sign in to comment.