From 5e3259e98ecc60e169e0cc3025afb3001a3c3786 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Fri, 15 Jun 2018 23:12:52 -0400 Subject: [PATCH] Add test for #27597 The problem here was that we had an incomplete phi from a multi-branch, but the logic that fills up the phi with `undef`s for incomplete phis, only added one entry to the phi node. Rather than the two that LLVM was expecting. Since the previous commit prevents us from turning conditional branches into multi-edge phis, this problem does not occur anymore. With this test, this fixes #27597 --- test/core.jl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/core.jl b/test/core.jl index 247f116793a85..d17be11a27309 100644 --- a/test/core.jl +++ b/test/core.jl @@ -6219,3 +6219,19 @@ function foo27594() end @test foo27594() == 1 + +# Issue 27597 +function f27597(y) + x = Int[] + + if isempty(y) + y = 1:length(x) + elseif false + ; + end + + length(y) + return y +end +@test f27597([1]) == [1] +@test f27597([]) == 1:0