Skip to content

Commit 5f39c10

Browse files
dkarraschamilsted
andcommitted
Add test
Co-authored-by: Ashley Milsted <[email protected]>
1 parent 3fdacb5 commit 5f39c10

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
@@ -736,6 +736,19 @@ transpose(x::RootInt) = x
736736
@test A * a == [56]
737737
end
738738

739+
@testset "#46865: mul!() with non-const alpha, beta" begin
740+
f!(C,A,B,alphas,betas) = mul!(C, A, B, alphas[1], betas[1])
741+
alphas = [1.0]
742+
betas = [0.5]
743+
for d in [2,3,4] # test native small-matrix cases as well as BLAS
744+
A = rand(d,d)
745+
B = copy(A)
746+
C = copy(A)
747+
f!(C, A, B, alphas, betas)
748+
@test (@allocated f!(C, A, B, alphas, betas)) == 0
749+
end
750+
end
751+
739752
function test_mul(C, A, B, S)
740753
mul!(C, A, B)
741754
@test Array(A) * Array(B) C

0 commit comments

Comments
 (0)