diff --git a/test/arrayops.jl b/test/arrayops.jl index 7d3a1cfa64c7f..cda9ba7b2fee9 100644 --- a/test/arrayops.jl +++ b/test/arrayops.jl @@ -3324,14 +3324,14 @@ end end @test f() === 4.0 function confuse_alias_analysis() - mem0 = Memory{Int}(undef, 1) - mem1 = Memory{Int}(undef, 1) - @inbounds mem0[1] = 3 - for width in 1:2 - @inbounds mem1[1] = mem0[1] - mem0 = mem1 - end - mem0[1] + mem0 = Memory{Int}(undef, 1) + mem1 = Memory{Int}(undef, 1) + @inbounds mem0[1] = 3 + for width in 1:2 + @inbounds mem1[1] = mem0[1] + mem0 = mem1 + end + mem0[1] end @test confuse_alias_analysis() == 3 @test_broken (@allocated confuse_alias_analysis()) == 0