Skip to content

Commit 834aad4

Browse files
authored
Add (broken) tests for allocation in 5-arg mul!() (#49210)
1 parent df09f67 commit 834aad4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

stdlib/LinearAlgebra/test/matmul.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,4 +979,17 @@ end
979979
end
980980
end
981981

982+
@testset "Issue #46865: mul!() with non-const alpha, beta" begin
983+
f!(C,A,B,alphas,betas) = mul!(C, A, B, alphas[1], betas[1])
984+
alphas = [1.0]
985+
betas = [0.5]
986+
for d in [2,3,4] # test native small-matrix cases as well as BLAS
987+
A = rand(d,d)
988+
B = copy(A)
989+
C = copy(A)
990+
f!(C, A, B, alphas, betas)
991+
@test_broken (@allocated f!(C, A, B, alphas, betas)) == 0
992+
end
993+
end
994+
982995
end # module TestMatmul

0 commit comments

Comments
 (0)