diff --git a/src/Cthulhu.jl b/src/Cthulhu.jl index a36203e5..62ea6adf 100644 --- a/src/Cthulhu.jl +++ b/src/Cthulhu.jl @@ -231,7 +231,7 @@ function _descend(term::AbstractTerminal, interp::CthulhuInterpreter, mi::Method override::Union{Nothing,InferenceResult}=nothing, debuginfo::Union{Symbol,DebugInfo}=DInfo.compact, # default is compact debuginfo params=current_params(), optimize::Bool=true, interruptexc::Bool=true, iswarn::Bool=false, hide_type_stable::Union{Nothing,Bool}=nothing, verbose::Union{Nothing,Bool}=nothing, - remarks::Bool=false, inline_cost::Bool=false) + remarks::Bool=false, inline_cost::Bool=false, type_annotations::Bool=true) if isnothing(hide_type_stable) hide_type_stable = something(verbose, false) end @@ -287,11 +287,11 @@ function _descend(term::AbstractTerminal, interp::CthulhuInterpreter, mi::Method if debuginfo == DInfo.compact str = let debuginfo=debuginfo, codeinf=codeinf, rt=rt, mi=mi, iswarn=iswarn, hide_type_stable=hide_type_stable, - remarks=_remarks, inline_cost=inline_cost + remarks=_remarks, inline_cost=inline_cost, type_annotations=type_annotations stringify() do io # eliminate trailing indentation (see first item in bullet list in PR #189) cthulhu_typed(io, debuginfo, codeinf, rt, mi; iswarn, hide_type_stable, - remarks, inline_cost) + remarks, inline_cost, type_annotations) end end rmatch = findfirst(r"\u001B\[90m\u001B\[(\d+)G( *)\u001B\[1G\u001B\[39m\u001B\[90m( *)\u001B\[39m$", str) @@ -302,7 +302,7 @@ function _descend(term::AbstractTerminal, interp::CthulhuInterpreter, mi::Method else cthulhu_typed(term.out_stream::IO, debuginfo, codeinf, rt, mi; iswarn, hide_type_stable, - remarks=_remarks, inline_cost) + remarks=_remarks, inline_cost, type_annotations) end view_cmd = cthulhu_typed end @@ -310,7 +310,7 @@ function _descend(term::AbstractTerminal, interp::CthulhuInterpreter, mi::Method end menu = CthulhuMenu(callsites, optimize, iswarn&get(term.out_stream::IO, :color, false)::Bool; menu_options...) - usg = usage(view_cmd, optimize, iswarn, hide_type_stable, debuginfo, remarks, inline_cost, CONFIG.enable_highlighter) + usg = usage(view_cmd, optimize, iswarn, hide_type_stable, debuginfo, remarks, inline_cost, type_annotations, CONFIG.enable_highlighter) cid = request(term, usg, menu) toggle = menu.toggle @@ -354,7 +354,7 @@ function _descend(term::AbstractTerminal, interp::CthulhuInterpreter, mi::Method debuginfo, params, optimize, interruptexc, iswarn, hide_type_stable, - remarks, inline_cost) + remarks, inline_cost, type_annotations) continue end @@ -372,7 +372,7 @@ function _descend(term::AbstractTerminal, interp::CthulhuInterpreter, mi::Method override = isa(info, ConstPropCallInfo) ? info.result : nothing, debuginfo, params,optimize, interruptexc, iswarn, hide_type_stable, - remarks, inline_cost) + remarks, inline_cost, type_annotations) elseif toggle === :warn iswarn ⊻= true @@ -396,6 +396,8 @@ function _descend(term::AbstractTerminal, interp::CthulhuInterpreter, mi::Method if inline_cost && !optimize @warn "enable optimization to see the inlining costs" end + elseif toggle === :type_annotations + type_annotations ⊻= true elseif toggle === :highlighter CONFIG.enable_highlighter ⊻= true if CONFIG.enable_highlighter diff --git a/src/codeview.jl b/src/codeview.jl index 0337451d..ebdfb7e4 100644 --- a/src/codeview.jl +++ b/src/codeview.jl @@ -107,7 +107,9 @@ cthulhu_typed(io::IO, debuginfo::DebugInfo, args...; kwargs...) = function cthulhu_typed(io::IO, debuginfo::Symbol, src::Union{CodeInfo,IRCode}, @nospecialize(rt), mi::Union{Nothing,MethodInstance}; iswarn::Bool=false, hide_type_stable::Bool=false, - remarks::Union{Nothing,Remarks}=nothing, inline_cost::Bool=false) + remarks::Union{Nothing,Remarks}=nothing, inline_cost::Bool=false, + type_annotations::Bool=true) + debuginfo = IRShow.debuginfo(debuginfo) lineprinter = __debuginfo[debuginfo] rettype = ignorelimited(rt) @@ -159,7 +161,11 @@ function cthulhu_typed(io::IO, debuginfo::Symbol, preprinter = lineprinter(src) end # postprinter configuration - _postprinter = iswarn ? InteractiveUtils.warntype_type_printer : IRShow.default_expr_type_printer + _postprinter = if type_annotations + iswarn ? InteractiveUtils.warntype_type_printer : IRShow.default_expr_type_printer + else + Returns(nothing) + end if !isnothing(remarks) function postprinter(io::IO, @nospecialize(typ), used::Bool) _postprinter(io, typ, used) diff --git a/src/ui.jl b/src/ui.jl index e19959ef..aae0befd 100644 --- a/src/ui.jl +++ b/src/ui.jl @@ -46,7 +46,7 @@ function stringify(@nospecialize(f), io::IO=IOBuffer()) end const debugcolors = (:nothing, :light_black, :yellow) -function usage(@nospecialize(view_cmd), optimize, iswarn, hide_type_stable, debuginfo, remarks, inline_cost, highlight) +function usage(@nospecialize(view_cmd), optimize, iswarn, hide_type_stable, debuginfo, remarks, inline_cost, type_annotations, highlight) colorize(iotmp, use_color::Bool, c::Char) = stringify(iotmp) do io use_color ? printstyled(io, c; color=:cyan) : print(io, c) end @@ -64,6 +64,7 @@ function usage(@nospecialize(view_cmd), optimize, iswarn, hide_type_stable, debu end, "]ebuginfo, [", colorize(iotmp, remarks, 'r'), "]emarks, [", colorize(iotmp, inline_cost, 'i'), "]nlining costs, [", + colorize(iotmp, type_annotations, 't'), "]ype annotations, [", colorize(iotmp, highlight, 's'), "]yntax highlight for Source/LLVM/Native.") println(ioctx, "Show: [", colorize(iotmp, view_cmd === cthulhu_source, 'S'), "]ource code, [", @@ -98,6 +99,9 @@ function TerminalMenus.keypress(m::CthulhuMenu, key::UInt32) elseif key == UInt32('i') m.toggle = :inline_cost return true + elseif key == UInt32('t') + m.toggle = :type_annotations + return true elseif key == UInt32('s') m.toggle = :highlighter return true diff --git a/test/codeview.jl b/test/codeview.jl index 5ad08f34..d075e1b6 100644 --- a/test/codeview.jl +++ b/test/codeview.jl @@ -27,11 +27,13 @@ Revise.track(CthulhuTestSandbox, normpath(@__DIR__, "sandbox.jl")) @testset "iswarn: $iswarn" for iswarn in tf @testset "hide_type_stable: $hide_type_stable" for hide_type_stable in tf @testset "inline_cost: $inline_cost" for inline_cost in tf - io = IOBuffer() - Cthulhu.cthulhu_typed(io, debuginfo, - src, rt, mi; - iswarn, hide_type_stable, inline_cost) - @test !isempty(String(take!(io))) # just check it works + @testset "type_annotations: $type_annotations" for type_annotations in tf + io = IOBuffer() + Cthulhu.cthulhu_typed(io, debuginfo, + src, rt, mi; + iswarn, hide_type_stable, inline_cost, type_annotations) + @test !isempty(String(take!(io))) # just check it works + end end end end diff --git a/test/irshow.jl b/test/irshow.jl index 54c1a840..d4e44a11 100644 --- a/test/irshow.jl +++ b/test/irshow.jl @@ -25,22 +25,24 @@ end @testset "iswarn: $iswarn" for iswarn in tf @testset "hide_type_stable: $hide_type_stable" for hide_type_stable in tf @testset "inline_cost: $inline_cost" for inline_cost in tf - !optimize && debuginfo === Cthulhu.DInfo.compact && continue - !optimize && inline_cost && continue + @testset "type_annotations: $type_annotations" for type_annotations in tf + !optimize && debuginfo === Cthulhu.DInfo.compact && continue + !optimize && inline_cost && continue - s = sprint(; context=:color=>true) do io - Cthulhu.cthulhu_typed(io, debuginfo, - src, rt, mi; - iswarn, hide_type_stable, inline_cost) - end - s = strip_base_linenums(s) + s = sprint(; context=:color=>true) do io + Cthulhu.cthulhu_typed(io, debuginfo, + src, rt, mi; + iswarn, hide_type_stable, inline_cost, type_annotations) + end + s = strip_base_linenums(s) - ground_truth = read(irshow_filename(optimize, debuginfo, iswarn, hide_type_stable, inline_cost), String) - if Sys.iswindows() - ground_truth = replace(ground_truth, "\r\n" => "\n") + ground_truth = read(irshow_filename(optimize, debuginfo, iswarn, hide_type_stable, inline_cost, type_annotations), String) + if Sys.iswindows() + ground_truth = replace(ground_truth, "\r\n" => "\n") + end + @test s == ground_truth + s != ground_truth && println(deepdiff(s, ground_truth)) end - @test s == ground_truth - s != ground_truth && println(deepdiff(s, ground_truth)) end end end diff --git a/test/test_output/foo-opt-compact-nowarn-hide_type_stable-inline_cost-notypes b/test/test_output/foo-opt-compact-nowarn-hide_type_stable-inline_cost-notypes new file mode 100644 index 00000000..c741690e --- /dev/null +++ b/test/test_output/foo-opt-compact-nowarn-hide_type_stable-inline_cost-notypes @@ -0,0 +1,10 @@ +│ ─ %-1 = invoke foo(::Int64,::Int64)::Any +││ │  0 %2 = %new(%1) +│  4 ┄─ 0 %9 = Core.getfield(%2, :contents) +│  │  1000 %10 = (%9 < 4) +│  8 ┄─ 0 %16 = Core.getfield(%2, :contents) +│  │  1000 %17 = (%16 + 1) +│  │  20 %20 = invoke %19(_2::Int64) +│  14 ┄ 0 %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│ 8 │  1000 %31 = (%20 + %30) +   \ No newline at end of file diff --git a/test/test_output/foo-opt-compact-nowarn-hide_type_stable-inline_cost b/test/test_output/foo-opt-compact-nowarn-hide_type_stable-inline_cost-types similarity index 100% rename from test/test_output/foo-opt-compact-nowarn-hide_type_stable-inline_cost rename to test/test_output/foo-opt-compact-nowarn-hide_type_stable-inline_cost-types diff --git a/test/test_output/foo-opt-compact-nowarn-hide_type_stable-nocost-notypes b/test/test_output/foo-opt-compact-nowarn-hide_type_stable-nocost-notypes new file mode 100644 index 00000000..fd9fc378 --- /dev/null +++ b/test/test_output/foo-opt-compact-nowarn-hide_type_stable-nocost-notypes @@ -0,0 +1,10 @@ +│ ─ %-1 = invoke foo(::Int64,::Int64)::Any +││ │ %2 = %new(%1) +│  4 ┄─ %9 = Core.getfield(%2, :contents) +│  │ %10 = (%9 < 4) +│  8 ┄─ %16 = Core.getfield(%2, :contents) +│  │ %17 = (%16 + 1) +│  │ %20 = invoke %19(_2::Int64) +│  14 ┄ %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│ 8 │ %31 = (%20 + %30) +   \ No newline at end of file diff --git a/test/test_output/foo-opt-compact-nowarn-hide_type_stable-nocost b/test/test_output/foo-opt-compact-nowarn-hide_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-opt-compact-nowarn-hide_type_stable-nocost rename to test/test_output/foo-opt-compact-nowarn-hide_type_stable-nocost-types diff --git a/test/test_output/foo-opt-compact-nowarn-show_type_stable-inline_cost-notypes b/test/test_output/foo-opt-compact-nowarn-show_type_stable-inline_cost-notypes new file mode 100644 index 00000000..befcf89f --- /dev/null +++ b/test/test_output/foo-opt-compact-nowarn-show_type_stable-inline_cost-notypes @@ -0,0 +1,34 @@ +│ ─ %-1 = invoke foo(::Int64,::Int64)::Any +│╻ Box2 1 ── 0 %1 = Core.Box +││ │  0 %2 = %new(%1) +│╻ + │  1 %3 = Base.add_int(_2, _3) +│  │  3 Core.setfield!(%2, :contents, %3) +│ 3 │  1 %5 = Core.isdefined(%2, :contents) +│  └─── 0 goto #3 if not %5 +│  2 ── 0 goto #4 +│  3 ── 0 $(Expr(:throw_undef_if_not, :z, false)) +│  4 ┄─ 0 %9 = Core.getfield(%2, :contents) +│  │  1000 %10 = (%9 < 4) +│  └─── 0 goto #9 if not %10 +│ 4 5 ── 1 %12 = Core.isdefined(%2, :contents) +│  └─── 0 goto #7 if not %12 +│  6 ── 0 goto #8 +│  7 ── 0 $(Expr(:throw_undef_if_not, :z, false)) +│  8 ┄─ 0 %16 = Core.getfield(%2, :contents) +│  │  1000 %17 = (%16 + 1) +│  └─── 3 Core.setfield!(%2, :contents, %17) +│ 6 9 ┄─ 0 %19 = %new(Main.anonymous.:(var"#1#2"), %2) +│  │  20 %20 = invoke %19(_2::Int64) +│ 7 │  1 %21 = (isa)(_2, Missing) +│  └─── 0 goto #11 if not %21 +│  10 ─ 0 goto #14 +│  11 ─ 1 %24 = (isa)(_2, Int64) +│  └─── 0 goto #13 if not %24 +│╻ + 12 ─ 1 %26 = Base.add_int(_2, _3) +│  └─── 0 goto #14 +│  13 ─ 0 Core.throw(ErrorException("fatal error in type inference (type bound)")) +│  └─── 0 unreachable +│  14 ┄ 0 %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│ 8 │  1000 %31 = (%20 + %30) +│  └─── 0 return %31 +   \ No newline at end of file diff --git a/test/test_output/foo-opt-compact-nowarn-show_type_stable-inline_cost b/test/test_output/foo-opt-compact-nowarn-show_type_stable-inline_cost-types similarity index 100% rename from test/test_output/foo-opt-compact-nowarn-show_type_stable-inline_cost rename to test/test_output/foo-opt-compact-nowarn-show_type_stable-inline_cost-types diff --git a/test/test_output/foo-opt-compact-nowarn-show_type_stable-nocost-notypes b/test/test_output/foo-opt-compact-nowarn-show_type_stable-nocost-notypes new file mode 100644 index 00000000..c2ff9e57 --- /dev/null +++ b/test/test_output/foo-opt-compact-nowarn-show_type_stable-nocost-notypes @@ -0,0 +1,34 @@ +│ ─ %-1 = invoke foo(::Int64,::Int64)::Any +│╻ Box2 1 ── %1 = Core.Box +││ │ %2 = %new(%1) +│╻ + │ %3 = Base.add_int(_2, _3) +│  │ Core.setfield!(%2, :contents, %3) +│ 3 │ %5 = Core.isdefined(%2, :contents) +│  └─── goto #3 if not %5 +│  2 ── goto #4 +│  3 ── $(Expr(:throw_undef_if_not, :z, false)) +│  4 ┄─ %9 = Core.getfield(%2, :contents) +│  │ %10 = (%9 < 4) +│  └─── goto #9 if not %10 +│ 4 5 ── %12 = Core.isdefined(%2, :contents) +│  └─── goto #7 if not %12 +│  6 ── goto #8 +│  7 ── $(Expr(:throw_undef_if_not, :z, false)) +│  8 ┄─ %16 = Core.getfield(%2, :contents) +│  │ %17 = (%16 + 1) +│  └─── Core.setfield!(%2, :contents, %17) +│ 6 9 ┄─ %19 = %new(Main.anonymous.:(var"#1#2"), %2) +│  │ %20 = invoke %19(_2::Int64) +│ 7 │ %21 = (isa)(_2, Missing) +│  └─── goto #11 if not %21 +│  10 ─ goto #14 +│  11 ─ %24 = (isa)(_2, Int64) +│  └─── goto #13 if not %24 +│╻ + 12 ─ %26 = Base.add_int(_2, _3) +│  └─── goto #14 +│  13 ─ Core.throw(ErrorException("fatal error in type inference (type bound)")) +│  └─── unreachable +│  14 ┄ %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│ 8 │ %31 = (%20 + %30) +│  └─── return %31 +   \ No newline at end of file diff --git a/test/test_output/foo-opt-compact-nowarn-show_type_stable-nocost b/test/test_output/foo-opt-compact-nowarn-show_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-opt-compact-nowarn-show_type_stable-nocost rename to test/test_output/foo-opt-compact-nowarn-show_type_stable-nocost-types diff --git a/test/test_output/foo-opt-compact-warn-hide_type_stable-inline_cost-notypes b/test/test_output/foo-opt-compact-warn-hide_type_stable-inline_cost-notypes new file mode 100644 index 00000000..f3a7c7e8 --- /dev/null +++ b/test/test_output/foo-opt-compact-warn-hide_type_stable-inline_cost-notypes @@ -0,0 +1,10 @@ +Body::Any +││ │  0 %2 = %new(%1) +│  4 ┄─ 0 %9 = Core.getfield(%2, :contents) +│  │  1000 %10 = (%9 < 4) +│  8 ┄─ 0 %16 = Core.getfield(%2, :contents) +│  │  1000 %17 = (%16 + 1) +│  │  20 %20 = invoke %19(_2::Int64) +│  14 ┄ 0 %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│ 8 │  1000 %31 = (%20 + %30) +   \ No newline at end of file diff --git a/test/test_output/foo-opt-compact-warn-hide_type_stable-inline_cost b/test/test_output/foo-opt-compact-warn-hide_type_stable-inline_cost-types similarity index 100% rename from test/test_output/foo-opt-compact-warn-hide_type_stable-inline_cost rename to test/test_output/foo-opt-compact-warn-hide_type_stable-inline_cost-types diff --git a/test/test_output/foo-opt-compact-warn-hide_type_stable-nocost-notypes b/test/test_output/foo-opt-compact-warn-hide_type_stable-nocost-notypes new file mode 100644 index 00000000..4495876e --- /dev/null +++ b/test/test_output/foo-opt-compact-warn-hide_type_stable-nocost-notypes @@ -0,0 +1,10 @@ +Body::Any +││ │ %2 = %new(%1) +│  4 ┄─ %9 = Core.getfield(%2, :contents) +│  │ %10 = (%9 < 4) +│  8 ┄─ %16 = Core.getfield(%2, :contents) +│  │ %17 = (%16 + 1) +│  │ %20 = invoke %19(_2::Int64) +│  14 ┄ %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│ 8 │ %31 = (%20 + %30) +   \ No newline at end of file diff --git a/test/test_output/foo-opt-compact-warn-hide_type_stable-nocost b/test/test_output/foo-opt-compact-warn-hide_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-opt-compact-warn-hide_type_stable-nocost rename to test/test_output/foo-opt-compact-warn-hide_type_stable-nocost-types diff --git a/test/test_output/foo-opt-compact-warn-show_type_stable-inline_cost-notypes b/test/test_output/foo-opt-compact-warn-show_type_stable-inline_cost-notypes new file mode 100644 index 00000000..02f8a4aa --- /dev/null +++ b/test/test_output/foo-opt-compact-warn-show_type_stable-inline_cost-notypes @@ -0,0 +1,34 @@ +Body::Any +│╻ Box2 1 ── 0 %1 = Core.Box +││ │  0 %2 = %new(%1) +│╻ + │  1 %3 = Base.add_int(_2, _3) +│  │  3 Core.setfield!(%2, :contents, %3) +│ 3 │  1 %5 = Core.isdefined(%2, :contents) +│  └─── 0 goto #3 if not %5 +│  2 ── 0 goto #4 +│  3 ── 0 $(Expr(:throw_undef_if_not, :z, false)) +│  4 ┄─ 0 %9 = Core.getfield(%2, :contents) +│  │  1000 %10 = (%9 < 4) +│  └─── 0 goto #9 if not %10 +│ 4 5 ── 1 %12 = Core.isdefined(%2, :contents) +│  └─── 0 goto #7 if not %12 +│  6 ── 0 goto #8 +│  7 ── 0 $(Expr(:throw_undef_if_not, :z, false)) +│  8 ┄─ 0 %16 = Core.getfield(%2, :contents) +│  │  1000 %17 = (%16 + 1) +│  └─── 3 Core.setfield!(%2, :contents, %17) +│ 6 9 ┄─ 0 %19 = %new(Main.anonymous.:(var"#1#2"), %2) +│  │  20 %20 = invoke %19(_2::Int64) +│ 7 │  1 %21 = (isa)(_2, Missing) +│  └─── 0 goto #11 if not %21 +│  10 ─ 0 goto #14 +│  11 ─ 1 %24 = (isa)(_2, Int64) +│  └─── 0 goto #13 if not %24 +│╻ + 12 ─ 1 %26 = Base.add_int(_2, _3) +│  └─── 0 goto #14 +│  13 ─ 0 Core.throw(ErrorException("fatal error in type inference (type bound)")) +│  └─── 0 unreachable +│  14 ┄ 0 %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│ 8 │  1000 %31 = (%20 + %30) +│  └─── 0 return %31 +   \ No newline at end of file diff --git a/test/test_output/foo-opt-compact-warn-show_type_stable-inline_cost b/test/test_output/foo-opt-compact-warn-show_type_stable-inline_cost-types similarity index 100% rename from test/test_output/foo-opt-compact-warn-show_type_stable-inline_cost rename to test/test_output/foo-opt-compact-warn-show_type_stable-inline_cost-types diff --git a/test/test_output/foo-opt-compact-warn-show_type_stable-nocost-notypes b/test/test_output/foo-opt-compact-warn-show_type_stable-nocost-notypes new file mode 100644 index 00000000..7077295d --- /dev/null +++ b/test/test_output/foo-opt-compact-warn-show_type_stable-nocost-notypes @@ -0,0 +1,34 @@ +Body::Any +│╻ Box2 1 ── %1 = Core.Box +││ │ %2 = %new(%1) +│╻ + │ %3 = Base.add_int(_2, _3) +│  │ Core.setfield!(%2, :contents, %3) +│ 3 │ %5 = Core.isdefined(%2, :contents) +│  └─── goto #3 if not %5 +│  2 ── goto #4 +│  3 ── $(Expr(:throw_undef_if_not, :z, false)) +│  4 ┄─ %9 = Core.getfield(%2, :contents) +│  │ %10 = (%9 < 4) +│  └─── goto #9 if not %10 +│ 4 5 ── %12 = Core.isdefined(%2, :contents) +│  └─── goto #7 if not %12 +│  6 ── goto #8 +│  7 ── $(Expr(:throw_undef_if_not, :z, false)) +│  8 ┄─ %16 = Core.getfield(%2, :contents) +│  │ %17 = (%16 + 1) +│  └─── Core.setfield!(%2, :contents, %17) +│ 6 9 ┄─ %19 = %new(Main.anonymous.:(var"#1#2"), %2) +│  │ %20 = invoke %19(_2::Int64) +│ 7 │ %21 = (isa)(_2, Missing) +│  └─── goto #11 if not %21 +│  10 ─ goto #14 +│  11 ─ %24 = (isa)(_2, Int64) +│  └─── goto #13 if not %24 +│╻ + 12 ─ %26 = Base.add_int(_2, _3) +│  └─── goto #14 +│  13 ─ Core.throw(ErrorException("fatal error in type inference (type bound)")) +│  └─── unreachable +│  14 ┄ %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│ 8 │ %31 = (%20 + %30) +│  └─── return %31 +   \ No newline at end of file diff --git a/test/test_output/foo-opt-compact-warn-show_type_stable-nocost b/test/test_output/foo-opt-compact-warn-show_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-opt-compact-warn-show_type_stable-nocost rename to test/test_output/foo-opt-compact-warn-show_type_stable-nocost-types diff --git a/test/test_output/foo-opt-none-nowarn-hide_type_stable-inline_cost-notypes b/test/test_output/foo-opt-none-nowarn-hide_type_stable-inline_cost-notypes new file mode 100644 index 00000000..51780f16 --- /dev/null +++ b/test/test_output/foo-opt-none-nowarn-hide_type_stable-inline_cost-notypes @@ -0,0 +1,9 @@ +│ ─ %-1 = invoke foo(::Int64,::Int64)::Any +│  0 %2 = %new(%1) +4 ┄─ 0 %9 = Core.getfield(%2, :contents) +│  1000 %10 = (%9 < 4) +8 ┄─ 0 %16 = Core.getfield(%2, :contents) +│  1000 %17 = (%16 + 1) +│  20 %20 = invoke %19(_2::Int64) +14 ┄ 0 %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│  1000 %31 = (%20 + %30) diff --git a/test/test_output/foo-opt-none-nowarn-hide_type_stable-inline_cost b/test/test_output/foo-opt-none-nowarn-hide_type_stable-inline_cost-types similarity index 100% rename from test/test_output/foo-opt-none-nowarn-hide_type_stable-inline_cost rename to test/test_output/foo-opt-none-nowarn-hide_type_stable-inline_cost-types diff --git a/test/test_output/foo-opt-none-nowarn-hide_type_stable-nocost-notypes b/test/test_output/foo-opt-none-nowarn-hide_type_stable-nocost-notypes new file mode 100644 index 00000000..7560be7f --- /dev/null +++ b/test/test_output/foo-opt-none-nowarn-hide_type_stable-nocost-notypes @@ -0,0 +1,9 @@ +│ ─ %-1 = invoke foo(::Int64,::Int64)::Any +│  %2 = %new(%1) +4 ┄─ %9 = Core.getfield(%2, :contents) +│  %10 = (%9 < 4) +8 ┄─ %16 = Core.getfield(%2, :contents) +│  %17 = (%16 + 1) +│  %20 = invoke %19(_2::Int64) +14 ┄ %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│  %31 = (%20 + %30) diff --git a/test/test_output/foo-opt-none-nowarn-hide_type_stable-nocost b/test/test_output/foo-opt-none-nowarn-hide_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-opt-none-nowarn-hide_type_stable-nocost rename to test/test_output/foo-opt-none-nowarn-hide_type_stable-nocost-types diff --git a/test/test_output/foo-opt-none-nowarn-show_type_stable-inline_cost-notypes b/test/test_output/foo-opt-none-nowarn-show_type_stable-inline_cost-notypes new file mode 100644 index 00000000..8542cbbc --- /dev/null +++ b/test/test_output/foo-opt-none-nowarn-show_type_stable-inline_cost-notypes @@ -0,0 +1,33 @@ +│ ─ %-1 = invoke foo(::Int64,::Int64)::Any +1 ── 0 %1 = Core.Box +│  0 %2 = %new(%1) +│  1 %3 = Base.add_int(_2, _3) +│  3 Core.setfield!(%2, :contents, %3) +│  1 %5 = Core.isdefined(%2, :contents) +└─── 0 goto #3 if not %5 +2 ── 0 goto #4 +3 ── 0 $(Expr(:throw_undef_if_not, :z, false)) +4 ┄─ 0 %9 = Core.getfield(%2, :contents) +│  1000 %10 = (%9 < 4) +└─── 0 goto #9 if not %10 +5 ── 1 %12 = Core.isdefined(%2, :contents) +└─── 0 goto #7 if not %12 +6 ── 0 goto #8 +7 ── 0 $(Expr(:throw_undef_if_not, :z, false)) +8 ┄─ 0 %16 = Core.getfield(%2, :contents) +│  1000 %17 = (%16 + 1) +└─── 3 Core.setfield!(%2, :contents, %17) +9 ┄─ 0 %19 = %new(Main.anonymous.:(var"#1#2"), %2) +│  20 %20 = invoke %19(_2::Int64) +│  1 %21 = (isa)(_2, Missing) +└─── 0 goto #11 if not %21 +10 ─ 0 goto #14 +11 ─ 1 %24 = (isa)(_2, Int64) +└─── 0 goto #13 if not %24 +12 ─ 1 %26 = Base.add_int(_2, _3) +└─── 0 goto #14 +13 ─ 0 Core.throw(ErrorException("fatal error in type inference (type bound)")) +└─── 0 unreachable +14 ┄ 0 %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│  1000 %31 = (%20 + %30) +└─── 0 return %31 diff --git a/test/test_output/foo-opt-none-nowarn-show_type_stable-inline_cost b/test/test_output/foo-opt-none-nowarn-show_type_stable-inline_cost-types similarity index 100% rename from test/test_output/foo-opt-none-nowarn-show_type_stable-inline_cost rename to test/test_output/foo-opt-none-nowarn-show_type_stable-inline_cost-types diff --git a/test/test_output/foo-opt-none-nowarn-show_type_stable-nocost-notypes b/test/test_output/foo-opt-none-nowarn-show_type_stable-nocost-notypes new file mode 100644 index 00000000..a9ccb111 --- /dev/null +++ b/test/test_output/foo-opt-none-nowarn-show_type_stable-nocost-notypes @@ -0,0 +1,33 @@ +│ ─ %-1 = invoke foo(::Int64,::Int64)::Any +1 ── %1 = Core.Box +│  %2 = %new(%1) +│  %3 = Base.add_int(_2, _3) +│  Core.setfield!(%2, :contents, %3) +│  %5 = Core.isdefined(%2, :contents) +└─── goto #3 if not %5 +2 ── goto #4 +3 ── $(Expr(:throw_undef_if_not, :z, false)) +4 ┄─ %9 = Core.getfield(%2, :contents) +│  %10 = (%9 < 4) +└─── goto #9 if not %10 +5 ── %12 = Core.isdefined(%2, :contents) +└─── goto #7 if not %12 +6 ── goto #8 +7 ── $(Expr(:throw_undef_if_not, :z, false)) +8 ┄─ %16 = Core.getfield(%2, :contents) +│  %17 = (%16 + 1) +└─── Core.setfield!(%2, :contents, %17) +9 ┄─ %19 = %new(Main.anonymous.:(var"#1#2"), %2) +│  %20 = invoke %19(_2::Int64) +│  %21 = (isa)(_2, Missing) +└─── goto #11 if not %21 +10 ─ goto #14 +11 ─ %24 = (isa)(_2, Int64) +└─── goto #13 if not %24 +12 ─ %26 = Base.add_int(_2, _3) +└─── goto #14 +13 ─ Core.throw(ErrorException("fatal error in type inference (type bound)")) +└─── unreachable +14 ┄ %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│  %31 = (%20 + %30) +└─── return %31 diff --git a/test/test_output/foo-opt-none-nowarn-show_type_stable-nocost b/test/test_output/foo-opt-none-nowarn-show_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-opt-none-nowarn-show_type_stable-nocost rename to test/test_output/foo-opt-none-nowarn-show_type_stable-nocost-types diff --git a/test/test_output/foo-opt-none-warn-hide_type_stable-inline_cost-notypes b/test/test_output/foo-opt-none-warn-hide_type_stable-inline_cost-notypes new file mode 100644 index 00000000..ceafbd07 --- /dev/null +++ b/test/test_output/foo-opt-none-warn-hide_type_stable-inline_cost-notypes @@ -0,0 +1,9 @@ +Body::Any +│  0 %2 = %new(%1) +4 ┄─ 0 %9 = Core.getfield(%2, :contents) +│  1000 %10 = (%9 < 4) +8 ┄─ 0 %16 = Core.getfield(%2, :contents) +│  1000 %17 = (%16 + 1) +│  20 %20 = invoke %19(_2::Int64) +14 ┄ 0 %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│  1000 %31 = (%20 + %30) diff --git a/test/test_output/foo-opt-none-warn-hide_type_stable-inline_cost b/test/test_output/foo-opt-none-warn-hide_type_stable-inline_cost-types similarity index 100% rename from test/test_output/foo-opt-none-warn-hide_type_stable-inline_cost rename to test/test_output/foo-opt-none-warn-hide_type_stable-inline_cost-types diff --git a/test/test_output/foo-opt-none-warn-hide_type_stable-nocost-notypes b/test/test_output/foo-opt-none-warn-hide_type_stable-nocost-notypes new file mode 100644 index 00000000..7ec5d353 --- /dev/null +++ b/test/test_output/foo-opt-none-warn-hide_type_stable-nocost-notypes @@ -0,0 +1,9 @@ +Body::Any +│  %2 = %new(%1) +4 ┄─ %9 = Core.getfield(%2, :contents) +│  %10 = (%9 < 4) +8 ┄─ %16 = Core.getfield(%2, :contents) +│  %17 = (%16 + 1) +│  %20 = invoke %19(_2::Int64) +14 ┄ %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│  %31 = (%20 + %30) diff --git a/test/test_output/foo-opt-none-warn-hide_type_stable-nocost b/test/test_output/foo-opt-none-warn-hide_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-opt-none-warn-hide_type_stable-nocost rename to test/test_output/foo-opt-none-warn-hide_type_stable-nocost-types diff --git a/test/test_output/foo-opt-none-warn-show_type_stable-inline_cost-notypes b/test/test_output/foo-opt-none-warn-show_type_stable-inline_cost-notypes new file mode 100644 index 00000000..a2007ddb --- /dev/null +++ b/test/test_output/foo-opt-none-warn-show_type_stable-inline_cost-notypes @@ -0,0 +1,33 @@ +Body::Any +1 ── 0 %1 = Core.Box +│  0 %2 = %new(%1) +│  1 %3 = Base.add_int(_2, _3) +│  3 Core.setfield!(%2, :contents, %3) +│  1 %5 = Core.isdefined(%2, :contents) +└─── 0 goto #3 if not %5 +2 ── 0 goto #4 +3 ── 0 $(Expr(:throw_undef_if_not, :z, false)) +4 ┄─ 0 %9 = Core.getfield(%2, :contents) +│  1000 %10 = (%9 < 4) +└─── 0 goto #9 if not %10 +5 ── 1 %12 = Core.isdefined(%2, :contents) +└─── 0 goto #7 if not %12 +6 ── 0 goto #8 +7 ── 0 $(Expr(:throw_undef_if_not, :z, false)) +8 ┄─ 0 %16 = Core.getfield(%2, :contents) +│  1000 %17 = (%16 + 1) +└─── 3 Core.setfield!(%2, :contents, %17) +9 ┄─ 0 %19 = %new(Main.anonymous.:(var"#1#2"), %2) +│  20 %20 = invoke %19(_2::Int64) +│  1 %21 = (isa)(_2, Missing) +└─── 0 goto #11 if not %21 +10 ─ 0 goto #14 +11 ─ 1 %24 = (isa)(_2, Int64) +└─── 0 goto #13 if not %24 +12 ─ 1 %26 = Base.add_int(_2, _3) +└─── 0 goto #14 +13 ─ 0 Core.throw(ErrorException("fatal error in type inference (type bound)")) +└─── 0 unreachable +14 ┄ 0 %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│  1000 %31 = (%20 + %30) +└─── 0 return %31 diff --git a/test/test_output/foo-opt-none-warn-show_type_stable-inline_cost b/test/test_output/foo-opt-none-warn-show_type_stable-inline_cost-types similarity index 100% rename from test/test_output/foo-opt-none-warn-show_type_stable-inline_cost rename to test/test_output/foo-opt-none-warn-show_type_stable-inline_cost-types diff --git a/test/test_output/foo-opt-none-warn-show_type_stable-nocost-notypes b/test/test_output/foo-opt-none-warn-show_type_stable-nocost-notypes new file mode 100644 index 00000000..4d26b1ad --- /dev/null +++ b/test/test_output/foo-opt-none-warn-show_type_stable-nocost-notypes @@ -0,0 +1,33 @@ +Body::Any +1 ── %1 = Core.Box +│  %2 = %new(%1) +│  %3 = Base.add_int(_2, _3) +│  Core.setfield!(%2, :contents, %3) +│  %5 = Core.isdefined(%2, :contents) +└─── goto #3 if not %5 +2 ── goto #4 +3 ── $(Expr(:throw_undef_if_not, :z, false)) +4 ┄─ %9 = Core.getfield(%2, :contents) +│  %10 = (%9 < 4) +└─── goto #9 if not %10 +5 ── %12 = Core.isdefined(%2, :contents) +└─── goto #7 if not %12 +6 ── goto #8 +7 ── $(Expr(:throw_undef_if_not, :z, false)) +8 ┄─ %16 = Core.getfield(%2, :contents) +│  %17 = (%16 + 1) +└─── Core.setfield!(%2, :contents, %17) +9 ┄─ %19 = %new(Main.anonymous.:(var"#1#2"), %2) +│  %20 = invoke %19(_2::Int64) +│  %21 = (isa)(_2, Missing) +└─── goto #11 if not %21 +10 ─ goto #14 +11 ─ %24 = (isa)(_2, Int64) +└─── goto #13 if not %24 +12 ─ %26 = Base.add_int(_2, _3) +└─── goto #14 +13 ─ Core.throw(ErrorException("fatal error in type inference (type bound)")) +└─── unreachable +14 ┄ %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│  %31 = (%20 + %30) +└─── return %31 diff --git a/test/test_output/foo-opt-none-warn-show_type_stable-nocost b/test/test_output/foo-opt-none-warn-show_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-opt-none-warn-show_type_stable-nocost rename to test/test_output/foo-opt-none-warn-show_type_stable-nocost-types diff --git a/test/test_output/foo-opt-source-nowarn-hide_type_stable-inline_cost-notypes b/test/test_output/foo-opt-source-nowarn-hide_type_stable-inline_cost-notypes new file mode 100644 index 00000000..8914cd1b --- /dev/null +++ b/test/test_output/foo-opt-source-nowarn-hide_type_stable-inline_cost-notypes @@ -0,0 +1,17 @@ +│ ─ %-1 = invoke foo(::Int64,::Int64)::Any +│   @ foobar.jl:2 within `foo` +│  ┌ @ boot.jl: within `Box` +│  0 │ %2 = %new(%1) + └ +  @ foobar.jl:3 within `foo` +4 ┄─ 0 %9 = Core.getfield(%2, :contents) +│  1000 %10 = (%9 < 4) +  @ foobar.jl:4 within `foo` +8 ┄─ 0 %16 = Core.getfield(%2, :contents) +│  1000 %17 = (%16 + 1) +│   @ foobar.jl:6 within `foo` +│  20 %20 = invoke %19(_2::Int64) +  @ foobar.jl:7 within `foo` +14 ┄ 0 %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│   @ foobar.jl:8 within `foo` +│  1000 %31 = (%20 + %30) diff --git a/test/test_output/foo-opt-source-nowarn-hide_type_stable-inline_cost b/test/test_output/foo-opt-source-nowarn-hide_type_stable-inline_cost-types similarity index 100% rename from test/test_output/foo-opt-source-nowarn-hide_type_stable-inline_cost rename to test/test_output/foo-opt-source-nowarn-hide_type_stable-inline_cost-types diff --git a/test/test_output/foo-opt-source-nowarn-hide_type_stable-nocost-notypes b/test/test_output/foo-opt-source-nowarn-hide_type_stable-nocost-notypes new file mode 100644 index 00000000..663657d7 --- /dev/null +++ b/test/test_output/foo-opt-source-nowarn-hide_type_stable-nocost-notypes @@ -0,0 +1,17 @@ +│ ─ %-1 = invoke foo(::Int64,::Int64)::Any +│   @ foobar.jl:2 within `foo` +│  ┌ @ boot.jl: within `Box` +│ │ %2 = %new(%1) + └ +  @ foobar.jl:3 within `foo` +4 ┄─ %9 = Core.getfield(%2, :contents) +│  %10 = (%9 < 4) +  @ foobar.jl:4 within `foo` +8 ┄─ %16 = Core.getfield(%2, :contents) +│  %17 = (%16 + 1) +│   @ foobar.jl:6 within `foo` +│  %20 = invoke %19(_2::Int64) +  @ foobar.jl:7 within `foo` +14 ┄ %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│   @ foobar.jl:8 within `foo` +│  %31 = (%20 + %30) diff --git a/test/test_output/foo-opt-source-nowarn-hide_type_stable-nocost b/test/test_output/foo-opt-source-nowarn-hide_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-opt-source-nowarn-hide_type_stable-nocost rename to test/test_output/foo-opt-source-nowarn-hide_type_stable-nocost-types diff --git a/test/test_output/foo-opt-source-nowarn-show_type_stable-inline_cost-notypes b/test/test_output/foo-opt-source-nowarn-show_type_stable-inline_cost-notypes new file mode 100644 index 00000000..96ffe4f0 --- /dev/null +++ b/test/test_output/foo-opt-source-nowarn-show_type_stable-inline_cost-notypes @@ -0,0 +1,45 @@ +│ ─ %-1 = invoke foo(::Int64,::Int64)::Any +  @ foobar.jl:2 within `foo` + ┌ @ boot.jl: within `Box` +1 ── 0 │ %1 = Core.Box +│  0 │ %2 = %new(%1) +│  └ +│  ┌ @ int.jl: within `+` +│  1 │ %3 = Base.add_int(_2, _3) +│  └ +│  3 Core.setfield!(%2, :contents, %3) +│   @ foobar.jl:3 within `foo` +│  1 %5 = Core.isdefined(%2, :contents) +└─── 0 goto #3 if not %5 +2 ── 0 goto #4 +3 ── 0 $(Expr(:throw_undef_if_not, :z, false)) +4 ┄─ 0 %9 = Core.getfield(%2, :contents) +│  1000 %10 = (%9 < 4) +└─── 0 goto #9 if not %10 +  @ foobar.jl:4 within `foo` +5 ── 1 %12 = Core.isdefined(%2, :contents) +└─── 0 goto #7 if not %12 +6 ── 0 goto #8 +7 ── 0 $(Expr(:throw_undef_if_not, :z, false)) +8 ┄─ 0 %16 = Core.getfield(%2, :contents) +│  1000 %17 = (%16 + 1) +└─── 3 Core.setfield!(%2, :contents, %17) +  @ foobar.jl:6 within `foo` +9 ┄─ 0 %19 = %new(Main.anonymous.:(var"#1#2"), %2) +│  20 %20 = invoke %19(_2::Int64) +│   @ foobar.jl:7 within `foo` +│  1 %21 = (isa)(_2, Missing) +└─── 0 goto #11 if not %21 +10 ─ 0 goto #14 +11 ─ 1 %24 = (isa)(_2, Int64) +└─── 0 goto #13 if not %24 + ┌ @ int.jl: within `+` +12 ─ 1 │ %26 = Base.add_int(_2, _3) +│  └ +└─── 0 goto #14 +13 ─ 0 Core.throw(ErrorException("fatal error in type inference (type bound)")) +└─── 0 unreachable +14 ┄ 0 %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│   @ foobar.jl:8 within `foo` +│  1000 %31 = (%20 + %30) +└─── 0 return %31 diff --git a/test/test_output/foo-opt-source-nowarn-show_type_stable-inline_cost b/test/test_output/foo-opt-source-nowarn-show_type_stable-inline_cost-types similarity index 100% rename from test/test_output/foo-opt-source-nowarn-show_type_stable-inline_cost rename to test/test_output/foo-opt-source-nowarn-show_type_stable-inline_cost-types diff --git a/test/test_output/foo-opt-source-nowarn-show_type_stable-nocost-notypes b/test/test_output/foo-opt-source-nowarn-show_type_stable-nocost-notypes new file mode 100644 index 00000000..803f8392 --- /dev/null +++ b/test/test_output/foo-opt-source-nowarn-show_type_stable-nocost-notypes @@ -0,0 +1,45 @@ +│ ─ %-1 = invoke foo(::Int64,::Int64)::Any +  @ foobar.jl:2 within `foo` + ┌ @ boot.jl: within `Box` +1 ──│ %1 = Core.Box +│ │ %2 = %new(%1) +│  └ +│  ┌ @ int.jl: within `+` +│ │ %3 = Base.add_int(_2, _3) +│  └ +│  Core.setfield!(%2, :contents, %3) +│   @ foobar.jl:3 within `foo` +│  %5 = Core.isdefined(%2, :contents) +└─── goto #3 if not %5 +2 ── goto #4 +3 ── $(Expr(:throw_undef_if_not, :z, false)) +4 ┄─ %9 = Core.getfield(%2, :contents) +│  %10 = (%9 < 4) +└─── goto #9 if not %10 +  @ foobar.jl:4 within `foo` +5 ── %12 = Core.isdefined(%2, :contents) +└─── goto #7 if not %12 +6 ── goto #8 +7 ── $(Expr(:throw_undef_if_not, :z, false)) +8 ┄─ %16 = Core.getfield(%2, :contents) +│  %17 = (%16 + 1) +└─── Core.setfield!(%2, :contents, %17) +  @ foobar.jl:6 within `foo` +9 ┄─ %19 = %new(Main.anonymous.:(var"#1#2"), %2) +│  %20 = invoke %19(_2::Int64) +│   @ foobar.jl:7 within `foo` +│  %21 = (isa)(_2, Missing) +└─── goto #11 if not %21 +10 ─ goto #14 +11 ─ %24 = (isa)(_2, Int64) +└─── goto #13 if not %24 + ┌ @ int.jl: within `+` +12 ─│ %26 = Base.add_int(_2, _3) +│  └ +└─── goto #14 +13 ─ Core.throw(ErrorException("fatal error in type inference (type bound)")) +└─── unreachable +14 ┄ %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│   @ foobar.jl:8 within `foo` +│  %31 = (%20 + %30) +└─── return %31 diff --git a/test/test_output/foo-opt-source-nowarn-show_type_stable-nocost b/test/test_output/foo-opt-source-nowarn-show_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-opt-source-nowarn-show_type_stable-nocost rename to test/test_output/foo-opt-source-nowarn-show_type_stable-nocost-types diff --git a/test/test_output/foo-opt-source-warn-hide_type_stable-inline_cost-notypes b/test/test_output/foo-opt-source-warn-hide_type_stable-inline_cost-notypes new file mode 100644 index 00000000..3a1750e4 --- /dev/null +++ b/test/test_output/foo-opt-source-warn-hide_type_stable-inline_cost-notypes @@ -0,0 +1,17 @@ +Body::Any +│   @ foobar.jl:2 within `foo` +│  ┌ @ boot.jl: within `Box` +│  0 │ %2 = %new(%1) + └ +  @ foobar.jl:3 within `foo` +4 ┄─ 0 %9 = Core.getfield(%2, :contents) +│  1000 %10 = (%9 < 4) +  @ foobar.jl:4 within `foo` +8 ┄─ 0 %16 = Core.getfield(%2, :contents) +│  1000 %17 = (%16 + 1) +│   @ foobar.jl:6 within `foo` +│  20 %20 = invoke %19(_2::Int64) +  @ foobar.jl:7 within `foo` +14 ┄ 0 %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│   @ foobar.jl:8 within `foo` +│  1000 %31 = (%20 + %30) diff --git a/test/test_output/foo-opt-source-warn-hide_type_stable-inline_cost b/test/test_output/foo-opt-source-warn-hide_type_stable-inline_cost-types similarity index 100% rename from test/test_output/foo-opt-source-warn-hide_type_stable-inline_cost rename to test/test_output/foo-opt-source-warn-hide_type_stable-inline_cost-types diff --git a/test/test_output/foo-opt-source-warn-hide_type_stable-nocost-notypes b/test/test_output/foo-opt-source-warn-hide_type_stable-nocost-notypes new file mode 100644 index 00000000..75b50341 --- /dev/null +++ b/test/test_output/foo-opt-source-warn-hide_type_stable-nocost-notypes @@ -0,0 +1,17 @@ +Body::Any +│   @ foobar.jl:2 within `foo` +│  ┌ @ boot.jl: within `Box` +│ │ %2 = %new(%1) + └ +  @ foobar.jl:3 within `foo` +4 ┄─ %9 = Core.getfield(%2, :contents) +│  %10 = (%9 < 4) +  @ foobar.jl:4 within `foo` +8 ┄─ %16 = Core.getfield(%2, :contents) +│  %17 = (%16 + 1) +│   @ foobar.jl:6 within `foo` +│  %20 = invoke %19(_2::Int64) +  @ foobar.jl:7 within `foo` +14 ┄ %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│   @ foobar.jl:8 within `foo` +│  %31 = (%20 + %30) diff --git a/test/test_output/foo-opt-source-warn-hide_type_stable-nocost b/test/test_output/foo-opt-source-warn-hide_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-opt-source-warn-hide_type_stable-nocost rename to test/test_output/foo-opt-source-warn-hide_type_stable-nocost-types diff --git a/test/test_output/foo-opt-source-warn-show_type_stable-inline_cost-notypes b/test/test_output/foo-opt-source-warn-show_type_stable-inline_cost-notypes new file mode 100644 index 00000000..793c73be --- /dev/null +++ b/test/test_output/foo-opt-source-warn-show_type_stable-inline_cost-notypes @@ -0,0 +1,45 @@ +Body::Any +  @ foobar.jl:2 within `foo` + ┌ @ boot.jl: within `Box` +1 ── 0 │ %1 = Core.Box +│  0 │ %2 = %new(%1) +│  └ +│  ┌ @ int.jl: within `+` +│  1 │ %3 = Base.add_int(_2, _3) +│  └ +│  3 Core.setfield!(%2, :contents, %3) +│   @ foobar.jl:3 within `foo` +│  1 %5 = Core.isdefined(%2, :contents) +└─── 0 goto #3 if not %5 +2 ── 0 goto #4 +3 ── 0 $(Expr(:throw_undef_if_not, :z, false)) +4 ┄─ 0 %9 = Core.getfield(%2, :contents) +│  1000 %10 = (%9 < 4) +└─── 0 goto #9 if not %10 +  @ foobar.jl:4 within `foo` +5 ── 1 %12 = Core.isdefined(%2, :contents) +└─── 0 goto #7 if not %12 +6 ── 0 goto #8 +7 ── 0 $(Expr(:throw_undef_if_not, :z, false)) +8 ┄─ 0 %16 = Core.getfield(%2, :contents) +│  1000 %17 = (%16 + 1) +└─── 3 Core.setfield!(%2, :contents, %17) +  @ foobar.jl:6 within `foo` +9 ┄─ 0 %19 = %new(Main.anonymous.:(var"#1#2"), %2) +│  20 %20 = invoke %19(_2::Int64) +│   @ foobar.jl:7 within `foo` +│  1 %21 = (isa)(_2, Missing) +└─── 0 goto #11 if not %21 +10 ─ 0 goto #14 +11 ─ 1 %24 = (isa)(_2, Int64) +└─── 0 goto #13 if not %24 + ┌ @ int.jl: within `+` +12 ─ 1 │ %26 = Base.add_int(_2, _3) +│  └ +└─── 0 goto #14 +13 ─ 0 Core.throw(ErrorException("fatal error in type inference (type bound)")) +└─── 0 unreachable +14 ┄ 0 %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│   @ foobar.jl:8 within `foo` +│  1000 %31 = (%20 + %30) +└─── 0 return %31 diff --git a/test/test_output/foo-opt-source-warn-show_type_stable-inline_cost b/test/test_output/foo-opt-source-warn-show_type_stable-inline_cost-types similarity index 100% rename from test/test_output/foo-opt-source-warn-show_type_stable-inline_cost rename to test/test_output/foo-opt-source-warn-show_type_stable-inline_cost-types diff --git a/test/test_output/foo-opt-source-warn-show_type_stable-nocost-notypes b/test/test_output/foo-opt-source-warn-show_type_stable-nocost-notypes new file mode 100644 index 00000000..e47165dd --- /dev/null +++ b/test/test_output/foo-opt-source-warn-show_type_stable-nocost-notypes @@ -0,0 +1,45 @@ +Body::Any +  @ foobar.jl:2 within `foo` + ┌ @ boot.jl: within `Box` +1 ──│ %1 = Core.Box +│ │ %2 = %new(%1) +│  └ +│  ┌ @ int.jl: within `+` +│ │ %3 = Base.add_int(_2, _3) +│  └ +│  Core.setfield!(%2, :contents, %3) +│   @ foobar.jl:3 within `foo` +│  %5 = Core.isdefined(%2, :contents) +└─── goto #3 if not %5 +2 ── goto #4 +3 ── $(Expr(:throw_undef_if_not, :z, false)) +4 ┄─ %9 = Core.getfield(%2, :contents) +│  %10 = (%9 < 4) +└─── goto #9 if not %10 +  @ foobar.jl:4 within `foo` +5 ── %12 = Core.isdefined(%2, :contents) +└─── goto #7 if not %12 +6 ── goto #8 +7 ── $(Expr(:throw_undef_if_not, :z, false)) +8 ┄─ %16 = Core.getfield(%2, :contents) +│  %17 = (%16 + 1) +└─── Core.setfield!(%2, :contents, %17) +  @ foobar.jl:6 within `foo` +9 ┄─ %19 = %new(Main.anonymous.:(var"#1#2"), %2) +│  %20 = invoke %19(_2::Int64) +│   @ foobar.jl:7 within `foo` +│  %21 = (isa)(_2, Missing) +└─── goto #11 if not %21 +10 ─ goto #14 +11 ─ %24 = (isa)(_2, Int64) +└─── goto #13 if not %24 + ┌ @ int.jl: within `+` +12 ─│ %26 = Base.add_int(_2, _3) +│  └ +└─── goto #14 +13 ─ Core.throw(ErrorException("fatal error in type inference (type bound)")) +└─── unreachable +14 ┄ %30 = φ (#10 => $(QuoteNode(missing)), #12 => %26) +│   @ foobar.jl:8 within `foo` +│  %31 = (%20 + %30) +└─── return %31 diff --git a/test/test_output/foo-opt-source-warn-show_type_stable-nocost b/test/test_output/foo-opt-source-warn-show_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-opt-source-warn-show_type_stable-nocost rename to test/test_output/foo-opt-source-warn-show_type_stable-nocost-types diff --git a/test/test_output/foo-unopt-none-nowarn-hide_type_stable-nocost-notypes b/test/test_output/foo-unopt-none-nowarn-hide_type_stable-nocost-notypes new file mode 100644 index 00000000..b169f2ce --- /dev/null +++ b/test/test_output/foo-unopt-none-nowarn-hide_type_stable-nocost-notypes @@ -0,0 +1,21 @@ +Variables + #self#::Core.Const(Main.anonymous.foo) + x::Int64 + y::Int64 + #1::Main.anonymous.var"#1#2" + v::Union{Missing, Int64} + u::Any + z@_7::Core.Box + z@_8::Union{} + z@_9::Union{} + +│ ─ %-1 = invoke foo(::Int64,::Int64)::Any +│  (z@_7 = Core.Box()) +4 ┄ %12 = Core.getfield(z@_7, :contents) +│  %13 = (%12 < 4) +8 ┄ %20 = Core.getfield(z@_7, :contents) +│  %21 = (%20 + 1) +│  (u = (%24)(x)) +│  %29 = Base.getindex(%28) +│  (v = %29 + y) +│  %31 = (u + v) diff --git a/test/test_output/foo-unopt-none-nowarn-hide_type_stable-nocost b/test/test_output/foo-unopt-none-nowarn-hide_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-unopt-none-nowarn-hide_type_stable-nocost rename to test/test_output/foo-unopt-none-nowarn-hide_type_stable-nocost-types diff --git a/test/test_output/foo-unopt-none-nowarn-show_type_stable-nocost-notypes b/test/test_output/foo-unopt-none-nowarn-show_type_stable-nocost-notypes new file mode 100644 index 00000000..94ab714c --- /dev/null +++ b/test/test_output/foo-unopt-none-nowarn-show_type_stable-nocost-notypes @@ -0,0 +1,44 @@ +Variables + #self#::Core.Const(Main.anonymous.foo) + x::Int64 + y::Int64 + #1::Main.anonymous.var"#1#2" + v::Union{Missing, Int64} + u::Any + z@_7::Core.Box + z@_8::Union{} + z@_9::Union{} + +│ ─ %-1 = invoke foo(::Int64,::Int64)::Any +1 ─ Core.NewvarNode(:(#1)) +│  Core.NewvarNode(:(v)) +│  Core.NewvarNode(:(u)) +│  (z@_7 = Core.Box()) +│  %5 = (x + y) +│  Core.setfield!(z@_7, :contents, %5) +│  %7 = Core.isdefined(z@_7, :contents) +└── goto #3 if not %7 +2 ─ goto #4 +3 ─ Core.NewvarNode(:(z@_8)) +└── z@_8 +4 ┄ %12 = Core.getfield(z@_7, :contents) +│  %13 = (%12 < 4) +└── goto #9 if not %13 +5 ─ %15 = Core.isdefined(z@_7, :contents) +└── goto #7 if not %15 +6 ─ goto #8 +7 ─ Core.NewvarNode(:(z@_9)) +└── z@_9 +8 ┄ %20 = Core.getfield(z@_7, :contents) +│  %21 = (%20 + 1) +└── Core.setfield!(z@_7, :contents, %21) +9 ┄ (#1 = %new(Main.anonymous.:(var"#1#2"), z@_7)) +│  %24 = #1 +│  (u = (%24)(x)) +│  %26 = Core.apply_type(Main.anonymous.Union, Main.anonymous.Int, Main.anonymous.Missing) +│  %27 = Core.apply_type(Main.anonymous.Ref, %26) +│  %28 = (%27)(x) +│  %29 = Base.getindex(%28) +│  (v = %29 + y) +│  %31 = (u + v) +└── return %31 diff --git a/test/test_output/foo-unopt-none-nowarn-show_type_stable-nocost b/test/test_output/foo-unopt-none-nowarn-show_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-unopt-none-nowarn-show_type_stable-nocost rename to test/test_output/foo-unopt-none-nowarn-show_type_stable-nocost-types diff --git a/test/test_output/foo-unopt-none-warn-hide_type_stable-nocost-notypes b/test/test_output/foo-unopt-none-warn-hide_type_stable-nocost-notypes new file mode 100644 index 00000000..e287678c --- /dev/null +++ b/test/test_output/foo-unopt-none-warn-hide_type_stable-nocost-notypes @@ -0,0 +1,21 @@ +Variables + #self#::Core.Const(Main.anonymous.foo) + x::Int64 + y::Int64 + #1::Main.anonymous.var"#1#2" + v::Union{Missing, Int64} + u::Any + z@_7::Core.Box + z@_8::Union{} + z@_9::Union{} + +Body::Any +│  (z@_7 = Core.Box()) +4 ┄ %12 = Core.getfield(z@_7, :contents) +│  %13 = (%12 < 4) +8 ┄ %20 = Core.getfield(z@_7, :contents) +│  %21 = (%20 + 1) +│  (u = (%24)(x)) +│  %29 = Base.getindex(%28) +│  (v = %29 + y) +│  %31 = (u + v) diff --git a/test/test_output/foo-unopt-none-warn-hide_type_stable-nocost b/test/test_output/foo-unopt-none-warn-hide_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-unopt-none-warn-hide_type_stable-nocost rename to test/test_output/foo-unopt-none-warn-hide_type_stable-nocost-types diff --git a/test/test_output/foo-unopt-none-warn-show_type_stable-nocost-notypes b/test/test_output/foo-unopt-none-warn-show_type_stable-nocost-notypes new file mode 100644 index 00000000..a35b2725 --- /dev/null +++ b/test/test_output/foo-unopt-none-warn-show_type_stable-nocost-notypes @@ -0,0 +1,44 @@ +Variables + #self#::Core.Const(Main.anonymous.foo) + x::Int64 + y::Int64 + #1::Main.anonymous.var"#1#2" + v::Union{Missing, Int64} + u::Any + z@_7::Core.Box + z@_8::Union{} + z@_9::Union{} + +Body::Any +1 ─ Core.NewvarNode(:(#1)) +│  Core.NewvarNode(:(v)) +│  Core.NewvarNode(:(u)) +│  (z@_7 = Core.Box()) +│  %5 = (x + y) +│  Core.setfield!(z@_7, :contents, %5) +│  %7 = Core.isdefined(z@_7, :contents) +└── goto #3 if not %7 +2 ─ goto #4 +3 ─ Core.NewvarNode(:(z@_8)) +└── z@_8 +4 ┄ %12 = Core.getfield(z@_7, :contents) +│  %13 = (%12 < 4) +└── goto #9 if not %13 +5 ─ %15 = Core.isdefined(z@_7, :contents) +└── goto #7 if not %15 +6 ─ goto #8 +7 ─ Core.NewvarNode(:(z@_9)) +└── z@_9 +8 ┄ %20 = Core.getfield(z@_7, :contents) +│  %21 = (%20 + 1) +└── Core.setfield!(z@_7, :contents, %21) +9 ┄ (#1 = %new(Main.anonymous.:(var"#1#2"), z@_7)) +│  %24 = #1 +│  (u = (%24)(x)) +│  %26 = Core.apply_type(Main.anonymous.Union, Main.anonymous.Int, Main.anonymous.Missing) +│  %27 = Core.apply_type(Main.anonymous.Ref, %26) +│  %28 = (%27)(x) +│  %29 = Base.getindex(%28) +│  (v = %29 + y) +│  %31 = (u + v) +└── return %31 diff --git a/test/test_output/foo-unopt-none-warn-show_type_stable-nocost b/test/test_output/foo-unopt-none-warn-show_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-unopt-none-warn-show_type_stable-nocost rename to test/test_output/foo-unopt-none-warn-show_type_stable-nocost-types diff --git a/test/test_output/foo-unopt-source-nowarn-hide_type_stable-nocost-notypes b/test/test_output/foo-unopt-source-nowarn-hide_type_stable-nocost-notypes new file mode 100644 index 00000000..b51562fb --- /dev/null +++ b/test/test_output/foo-unopt-source-nowarn-hide_type_stable-nocost-notypes @@ -0,0 +1,27 @@ +Variables + #self#::Core.Const(Main.anonymous.foo) + x::Int64 + y::Int64 + #1::Main.anonymous.var"#1#2" + v::Union{Missing, Int64} + u::Any + z@_7::Core.Box + z@_8::Union{} + z@_9::Union{} + +│ ─ %-1 = invoke foo(::Int64,::Int64)::Any +│   @ foobar.jl:2 within `foo` +│  (z@_7 = Core.Box()) +  @ foobar.jl:3 within `foo` +4 ┄ %12 = Core.getfield(z@_7, :contents) +│  %13 = (%12 < 4) +  @ foobar.jl:4 within `foo` +8 ┄ %20 = Core.getfield(z@_7, :contents) +│  %21 = (%20 + 1) +│   @ foobar.jl:6 within `foo` +│  (u = (%24)(x)) +│   @ foobar.jl:7 within `foo` +│  %29 = Base.getindex(%28) +│  (v = %29 + y) +│   @ foobar.jl:8 within `foo` +│  %31 = (u + v) diff --git a/test/test_output/foo-unopt-source-nowarn-hide_type_stable-nocost b/test/test_output/foo-unopt-source-nowarn-hide_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-unopt-source-nowarn-hide_type_stable-nocost rename to test/test_output/foo-unopt-source-nowarn-hide_type_stable-nocost-types diff --git a/test/test_output/foo-unopt-source-nowarn-show_type_stable-nocost-notypes b/test/test_output/foo-unopt-source-nowarn-show_type_stable-nocost-notypes new file mode 100644 index 00000000..f1b0e7aa --- /dev/null +++ b/test/test_output/foo-unopt-source-nowarn-show_type_stable-nocost-notypes @@ -0,0 +1,50 @@ +Variables + #self#::Core.Const(Main.anonymous.foo) + x::Int64 + y::Int64 + #1::Main.anonymous.var"#1#2" + v::Union{Missing, Int64} + u::Any + z@_7::Core.Box + z@_8::Union{} + z@_9::Union{} + +│ ─ %-1 = invoke foo(::Int64,::Int64)::Any +  @ foobar.jl:2 within `foo` +1 ─ Core.NewvarNode(:(#1)) +│  Core.NewvarNode(:(v)) +│  Core.NewvarNode(:(u)) +│  (z@_7 = Core.Box()) +│  %5 = (x + y) +│  Core.setfield!(z@_7, :contents, %5) +│   @ foobar.jl:3 within `foo` +│  %7 = Core.isdefined(z@_7, :contents) +└── goto #3 if not %7 +2 ─ goto #4 +3 ─ Core.NewvarNode(:(z@_8)) +└── z@_8 +4 ┄ %12 = Core.getfield(z@_7, :contents) +│  %13 = (%12 < 4) +└── goto #9 if not %13 +  @ foobar.jl:4 within `foo` +5 ─ %15 = Core.isdefined(z@_7, :contents) +└── goto #7 if not %15 +6 ─ goto #8 +7 ─ Core.NewvarNode(:(z@_9)) +└── z@_9 +8 ┄ %20 = Core.getfield(z@_7, :contents) +│  %21 = (%20 + 1) +└── Core.setfield!(z@_7, :contents, %21) +  @ foobar.jl:6 within `foo` +9 ┄ (#1 = %new(Main.anonymous.:(var"#1#2"), z@_7)) +│  %24 = #1 +│  (u = (%24)(x)) +│   @ foobar.jl:7 within `foo` +│  %26 = Core.apply_type(Main.anonymous.Union, Main.anonymous.Int, Main.anonymous.Missing) +│  %27 = Core.apply_type(Main.anonymous.Ref, %26) +│  %28 = (%27)(x) +│  %29 = Base.getindex(%28) +│  (v = %29 + y) +│   @ foobar.jl:8 within `foo` +│  %31 = (u + v) +└── return %31 diff --git a/test/test_output/foo-unopt-source-nowarn-show_type_stable-nocost b/test/test_output/foo-unopt-source-nowarn-show_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-unopt-source-nowarn-show_type_stable-nocost rename to test/test_output/foo-unopt-source-nowarn-show_type_stable-nocost-types diff --git a/test/test_output/foo-unopt-source-warn-hide_type_stable-nocost-notypes b/test/test_output/foo-unopt-source-warn-hide_type_stable-nocost-notypes new file mode 100644 index 00000000..063895a0 --- /dev/null +++ b/test/test_output/foo-unopt-source-warn-hide_type_stable-nocost-notypes @@ -0,0 +1,27 @@ +Variables + #self#::Core.Const(Main.anonymous.foo) + x::Int64 + y::Int64 + #1::Main.anonymous.var"#1#2" + v::Union{Missing, Int64} + u::Any + z@_7::Core.Box + z@_8::Union{} + z@_9::Union{} + +Body::Any +│   @ foobar.jl:2 within `foo` +│  (z@_7 = Core.Box()) +  @ foobar.jl:3 within `foo` +4 ┄ %12 = Core.getfield(z@_7, :contents) +│  %13 = (%12 < 4) +  @ foobar.jl:4 within `foo` +8 ┄ %20 = Core.getfield(z@_7, :contents) +│  %21 = (%20 + 1) +│   @ foobar.jl:6 within `foo` +│  (u = (%24)(x)) +│   @ foobar.jl:7 within `foo` +│  %29 = Base.getindex(%28) +│  (v = %29 + y) +│   @ foobar.jl:8 within `foo` +│  %31 = (u + v) diff --git a/test/test_output/foo-unopt-source-warn-hide_type_stable-nocost b/test/test_output/foo-unopt-source-warn-hide_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-unopt-source-warn-hide_type_stable-nocost rename to test/test_output/foo-unopt-source-warn-hide_type_stable-nocost-types diff --git a/test/test_output/foo-unopt-source-warn-show_type_stable-nocost-notypes b/test/test_output/foo-unopt-source-warn-show_type_stable-nocost-notypes new file mode 100644 index 00000000..db54a01f --- /dev/null +++ b/test/test_output/foo-unopt-source-warn-show_type_stable-nocost-notypes @@ -0,0 +1,50 @@ +Variables + #self#::Core.Const(Main.anonymous.foo) + x::Int64 + y::Int64 + #1::Main.anonymous.var"#1#2" + v::Union{Missing, Int64} + u::Any + z@_7::Core.Box + z@_8::Union{} + z@_9::Union{} + +Body::Any +  @ foobar.jl:2 within `foo` +1 ─ Core.NewvarNode(:(#1)) +│  Core.NewvarNode(:(v)) +│  Core.NewvarNode(:(u)) +│  (z@_7 = Core.Box()) +│  %5 = (x + y) +│  Core.setfield!(z@_7, :contents, %5) +│   @ foobar.jl:3 within `foo` +│  %7 = Core.isdefined(z@_7, :contents) +└── goto #3 if not %7 +2 ─ goto #4 +3 ─ Core.NewvarNode(:(z@_8)) +└── z@_8 +4 ┄ %12 = Core.getfield(z@_7, :contents) +│  %13 = (%12 < 4) +└── goto #9 if not %13 +  @ foobar.jl:4 within `foo` +5 ─ %15 = Core.isdefined(z@_7, :contents) +└── goto #7 if not %15 +6 ─ goto #8 +7 ─ Core.NewvarNode(:(z@_9)) +└── z@_9 +8 ┄ %20 = Core.getfield(z@_7, :contents) +│  %21 = (%20 + 1) +└── Core.setfield!(z@_7, :contents, %21) +  @ foobar.jl:6 within `foo` +9 ┄ (#1 = %new(Main.anonymous.:(var"#1#2"), z@_7)) +│  %24 = #1 +│  (u = (%24)(x)) +│   @ foobar.jl:7 within `foo` +│  %26 = Core.apply_type(Main.anonymous.Union, Main.anonymous.Int, Main.anonymous.Missing) +│  %27 = Core.apply_type(Main.anonymous.Ref, %26) +│  %28 = (%27)(x) +│  %29 = Base.getindex(%28) +│  (v = %29 + y) +│   @ foobar.jl:8 within `foo` +│  %31 = (u + v) +└── return %31 diff --git a/test/test_output/foo-unopt-source-warn-show_type_stable-nocost b/test/test_output/foo-unopt-source-warn-show_type_stable-nocost-types similarity index 100% rename from test/test_output/foo-unopt-source-warn-show_type_stable-nocost rename to test/test_output/foo-unopt-source-warn-show_type_stable-nocost-types diff --git a/test/utils.jl b/test/utils.jl index 38f1b71c..53cba462 100644 --- a/test/utils.jl +++ b/test/utils.jl @@ -23,9 +23,10 @@ function strip_base_linenums(s) return s end -function irshow_filename(optimize, debuginfo, iswarn, hide_type_stable, inline_cost) +function irshow_filename(optimize, debuginfo, iswarn, hide_type_stable, inline_cost, type_annotations) return "test_output/foo-$(optimize ? :opt : :unopt)-$(debuginfo)-$(iswarn ? :warn : :nowarn)\ --$(hide_type_stable ? :hide_type_stable : :show_type_stable)-$(inline_cost ? :inline_cost : :nocost)" + -$(hide_type_stable ? :hide_type_stable : :show_type_stable)-$(inline_cost ? :inline_cost : :nocost)\ + -$(type_annotations ? :types : :notypes)" end # to generate test cases for IRShow tests @@ -34,8 +35,8 @@ function generate_test_cases(foo) tf = (true, false) for optimize in tf _, src, infos, mi, rt, slottypes = process(foo, (Int, Int); optimize); - for (debuginfo, iswarn, hide_type_stable, inline_cost) in Iterators.product( - instances(Cthulhu.DInfo.DebugInfo), tf, tf, tf, + for (debuginfo, iswarn, hide_type_stable, inline_cost, type_annotations) in Iterators.product( + instances(Cthulhu.DInfo.DebugInfo), tf, tf, tf, tf, ) !optimize && debuginfo === Cthulhu.DInfo.compact && continue !optimize && inline_cost && continue @@ -43,14 +44,14 @@ function generate_test_cases(foo) s = sprint(; context=:color=>true) do io Cthulhu.cthulhu_typed(io, debuginfo, src, rt, mi; - iswarn, hide_type_stable, inline_cost) + iswarn, hide_type_stable, inline_cost, type_annotations) end s = strip_base_linenums(s) - write(irshow_filename(optimize, debuginfo, iswarn, hide_type_stable, inline_cost), s) + write(irshow_filename(optimize, debuginfo, iswarn, hide_type_stable, inline_cost, type_annotations), s) - in(s, values(outputs)) && (@show((optimize, debuginfo, iswarn, hide_type_stable, inline_cost)); @show(findfirst(==(s), pairs(outputs)))) + in(s, values(outputs)) && (@show((optimize, debuginfo, iswarn, hide_type_stable, inline_cost, type_annotations)); @show(findfirst(==(s), pairs(outputs)))) @assert !in(s, values(outputs)) - outputs[(optimize, debuginfo, iswarn, hide_type_stable, inline_cost)] = s + outputs[(optimize, debuginfo, iswarn, hide_type_stable, inline_cost, type_annotations)] = s end end end