Skip to content

Commit

Permalink
add test for JuliaLang#28079
Browse files Browse the repository at this point in the history
  • Loading branch information
jrevels authored and Keno committed Jul 15, 2018
1 parent 5459087 commit c125102
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/compiler/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1739,3 +1739,12 @@ T27078 = Vector{Vector{T}} where T
# issue #28070
g28070(f, args...) = f(args...)
@test @inferred g28070(Core._apply, Base.:/, (1.0, 1.0)) == 1.0

# issue #28079
struct Foo28079 end
@inline h28079(x, args...) = g28079(x, args...)
@inline g28079(::Any, f, args...) = f(args...)
test28079(p, n, m) = h28079(Foo28079(), Base.pointerref, p, n, m)
cinfo_unoptimized = code_typed(test28079, (Ptr{Float32}, Int, Int); optimize=false)[].first
cinfo_optimized = code_typed(test28079, (Ptr{Float32}, Int, Int); optimize=true)[].first
@test cinfo_unoptimized.ssavaluetypes[end-1] === cinfo_optimized.ssavaluetypes[end-1] === Float32

0 comments on commit c125102

Please sign in to comment.