Skip to content

Commit

Permalink
add test for thousands of function ast constants in a module
Browse files Browse the repository at this point in the history
closes #14113 (fixed previously)
  • Loading branch information
vtjnash committed Mar 28, 2016
1 parent 3f4ba52 commit 916b915
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3726,3 +3726,18 @@ end
@test foo1784()
@test a[1] == true
end

# issue #14113
module A14113
using Base.Test
# show that making several thousand methods (and lots of AST constants)
# doesn't cause any serious issues (for example, for the serializer)
# although to keep runtime on the order of several seconds for this test,
# only several hundred of them are compiled / called
for i = 1:2^14 + 256
r = rand(2^4)
code = Expr(:tuple, r...)
f = @eval () -> $code
i > (2^14 - 256) && @test [f()...] == r
end
end

0 comments on commit 916b915

Please sign in to comment.