From 444179bb8fffca0da4bdf7020e54099d740a592a Mon Sep 17 00:00:00 2001 From: KristofferC Date: Wed, 4 May 2022 09:53:18 +0200 Subject: [PATCH] add a test for #44501 --- test/compiler/codegen.jl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/compiler/codegen.jl b/test/compiler/codegen.jl index 9724091637f97..cad994c8907e4 100644 --- a/test/compiler/codegen.jl +++ b/test/compiler/codegen.jl @@ -734,3 +734,23 @@ f_donotdelete_input(x) = Base.donotdelete(x+1) f_donotdelete_const() = Base.donotdelete(1+1) @test occursin("call void (...) @jl_f_donotdelete(i64", get_llvm(f_donotdelete_input, Tuple{Int64}, true, false, false)) @test occursin("call void (...) @jl_f_donotdelete()", get_llvm(f_donotdelete_const, Tuple{}, true, false, false)) + + +str_44501 = """ +struct a_44501 +end +struct b_44501{c} + ch::c +end +children(d) = (d,) +e(i) = children(i) +f = a_44501 +g = b_44501(f) +h = g, nothing +[e(d) for d in h if isnothing(d)] +""" + +mktemp() do f_44501, _ + write(f_44501, str_44501) + @test success(`$(Base.julia_cmd()) --startup-file=no -O0 $f_44501`) +end