Skip to content

Commit bfcecc0

Browse files
committed
add test for thousands of function ast constants in a module
closes #14113 (fixed previously)
1 parent d799049 commit bfcecc0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/core.jl

+15
Original file line numberDiff line numberDiff line change
@@ -3726,3 +3726,18 @@ end
37263726
@test foo1784()
37273727
@test a[1] == true
37283728
end
3729+
3730+
# issue #14113
3731+
module A14113
3732+
using Base.Test
3733+
# show that making several thousand methods (and lots of AST constants)
3734+
# doesn't cause any serious issues (for example, for the serializer)
3735+
# although to keep runtime on the order of several seconds for this test,
3736+
# only several hundred of them are compiled / called
3737+
for i = 1:2^14 + 256
3738+
r = rand(2^4)
3739+
code = Expr(:tuple, r...)
3740+
f = @eval () -> $code
3741+
i > (2^14 - 256) && @test [f()...] == r
3742+
end
3743+
end

0 commit comments

Comments
 (0)