Skip to content

Commit

Permalink
test-codegen: make jl_dump_compiles test more reliable (#23486)
Browse files Browse the repository at this point in the history
This was a flaky test, and it's not entirely clear what it was testing.

Common failure was:
        FAILURE
    Error in testset codegen:
    Test Failed
      Expression: tempty == true
       Evaluated: false == true
    ERROR: LoadError: Test run finished with errors
    while loading C:\projects\julia\julia-a661736be5\share\julia\test\runtests.jl, in expression starting on line 29
    Command exited with code 1
  • Loading branch information
vtjnash authored Aug 29, 2017
1 parent 36990c7 commit 46bff1b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions test/codegen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,9 @@ end
function test_jl_dump_compiles()
tfile = tempname()
io = open(tfile, "w")
@eval(test_jl_dump_compiles_internal(x) = x)
ccall(:jl_dump_compiles, Void, (Ptr{Void},), io.handle)
eval(@noinline function test_jl_dump_compiles_internal(x)
if x > 0
test_jl_dump_compiles_internal(x-1)
end
end)
test_jl_dump_compiles_internal(1)
@eval test_jl_dump_compiles_internal(1)
ccall(:jl_dump_compiles, Void, (Ptr{Void},), C_NULL)
close(io)
tstats = stat(tfile)
Expand All @@ -71,8 +67,9 @@ end
function test_jl_dump_compiles_toplevel_thunks()
tfile = tempname()
io = open(tfile, "w")
topthunk = expand(Main, :(for i in 1:10; end))
ccall(:jl_dump_compiles, Void, (Ptr{Void},), io.handle)
eval(expand(Main, :(for i in 1:10 end)))
Core.eval(Main, topthunk)
ccall(:jl_dump_compiles, Void, (Ptr{Void},), C_NULL)
close(io)
tstats = stat(tfile)
Expand Down

0 comments on commit 46bff1b

Please sign in to comment.