Skip to content

Commit

Permalink
fix test to work with new optimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
jrevels committed May 4, 2018
1 parent 4aeeccf commit e4c90a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion base/compiler/ssair/inlining2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ function assemble_inline_todo!(ir::IRCode, linetable::Vector{LineInfoNode}, sv::
for tuparg in ir[def].args[2:end]
push!(new_atypes, exprtype(tuparg, ir, ir.mod))
end
elseif (isa(def, Argument) && def === stmt.args[end] && !isempty(sv.result_vargs))
elseif isa(def, Argument) && def === stmt.args[end] && !isempty(sv.result_vargs)
append!(new_atypes, sv.result_vargs)
else
append!(new_atypes, typ.parameters)
Expand Down
12 changes: 5 additions & 7 deletions test/compiler/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1536,9 +1536,9 @@ x26826 = rand()

apply26826(f, args...) = f(args...)

f26826(x) = apply26826(Base.getproperty, Foo26826(1, x), :b)
# We use getproperty to drive these tests because it requires constant
# propagation in order to lower to a well-inferred getfield call.
f26826(x) = apply26826(Base.getproperty, Foo26826(1, x), :b)

@test @inferred(f26826(x26826)) === x26826

Expand All @@ -1554,12 +1554,10 @@ g26826(x) = getfield26826(x, :a, :b)
# InferenceResult cache properly for varargs methods.
typed_code = Core.Compiler.code_typed(f26826, (Float64,))[1].first.code
found_well_typed_getfield_call = false
for stmnt in typed_code
if Meta.isexpr(stmnt, :(=)) && Meta.isexpr(stmnt.args[2], :call)
lhs = stmnt.args[2]
if lhs.args[1] == GlobalRef(Base, :getfield) && lhs.typ === Float64
global found_well_typed_getfield_call = true
end
for stmt in typed_code
lhs = Meta.isexpr(stmt, :(=)) ? stmt.args[2] : stmt
if Meta.isexpr(lhs, :call) && lhs.args[1] == GlobalRef(Base, :getfield) && lhs.typ === Float64
global found_well_typed_getfield_call = true
end
end

Expand Down

0 comments on commit e4c90a4

Please sign in to comment.