From c3aacff61b308e2e976fefbeaa3cf1245c034783 Mon Sep 17 00:00:00 2001 From: Pablo San-Jose Date: Sat, 27 Jan 2024 13:20:38 +0100 Subject: [PATCH] add test for #53054 --- stdlib/LinearAlgebra/test/blas.jl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/stdlib/LinearAlgebra/test/blas.jl b/stdlib/LinearAlgebra/test/blas.jl index d853b211e7817..80494da7babbe 100644 --- a/stdlib/LinearAlgebra/test/blas.jl +++ b/stdlib/LinearAlgebra/test/blas.jl @@ -135,6 +135,19 @@ Random.seed!(100) a[begin] = elty(NaN) @test BLAS.nrm2(a) === abs2(elty(NaN)) end + @testset "deterministic mul!" begin + # mul! should be deterministic, see #53054 + function tester_53054() + C = ComplexF32 + mat = zeros(C, 1, 1) + for _ in 1:100 + v = [C(1-0.2im) C(2+0.3im)] + mul!(mat, v, v', C(1+im), 1) + end + return mat + end + @test allequal(tester_53054() for _ in 1:10000) + end @testset "scal" begin α = rand(elty) a = rand(elty,n)