From e55b1dbcb9a073d0e35e6c0aa62600437647d404 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Sat, 29 Jul 2017 09:11:21 +0200 Subject: [PATCH] Add a test for #22582/#22022. --- test/codegen.jl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/codegen.jl b/test/codegen.jl index 52886657412a7..5c8c44e4fd241 100644 --- a/test/codegen.jl +++ b/test/codegen.jl @@ -231,3 +231,17 @@ function egal_svecs() end @test egal_svecs() @test Core.svec(:a, :b) === Core.svec(:a, :b) + +# issue #22582 +function issue22582!(a::AbstractArray, b) + len = length(a) + if b + ccall(:jl_array_grow_end, Void, (Any, Csize_t), a, 1) + end + return len +end +let c = [1,2,3] + len1 = length(c) + len2 = issue22582!(c, true) + @test len1 == len2 +end