From a3496f209b274e1f538360d65472daf0b3f2b209 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Thu, 11 Jan 2018 04:59:39 +0100 Subject: [PATCH] add test for array conversion reported in 22330 (#25448) --- test/codegen.jl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/codegen.jl b/test/codegen.jl index 73ed5ed3d9697..3d3be9ba537fd 100644 --- a/test/codegen.jl +++ b/test/codegen.jl @@ -322,3 +322,14 @@ end # the semi-boxed union on the if-branch of the `isa` is not annotated !nonnull @test contains(get_llvm_noopt(foo24632, (Bool,), false), "!dereferenceable_or_null") @test !contains(get_llvm_noopt(foo24632, (Bool,), false), "!nonnull") + +str_22330 = """ +Base.convert(::Type{Array{T,n}}, a::Array) where {T<:Number,n} = + copyto!(Array{T,n}(uninitialized, size(a)), a) + +empty(Dict(), Pair{Union{},Union{}}) +""" +f_22330 = tempname() +write(f_22330, str_22330) +@test success(`$(Base.julia_cmd()) --startup-file=no $f_22330`) +