Skip to content

Commit 8b00ed3

Browse files
giordanoKristofferC
authored andcommitted
Add test for use of Base.libblas_name
(cherry picked from commit a93ac54)
1 parent b9c655c commit 8b00ed3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

stdlib/LinearAlgebra/test/blas.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module TestBLAS
44

55
using Test, LinearAlgebra, Random
66
using LinearAlgebra: BlasReal, BlasComplex
7+
using Libdl: dlsym, dlopen
78
fabs(x::Real) = abs(x)
89
fabs(x::Complex) = abs(real(x)) + abs(imag(x))
910

@@ -713,4 +714,11 @@ end
713714
end
714715
end
715716

717+
# Make sure we can use `Base.libblas_name`. Avoid causing
718+
# https://github.com/JuliaLang/julia/issues/48427 again.
719+
@testset "libblas_name" begin
720+
dot_sym = dlsym(dlopen(Base.libblas_name), "cblas_ddot" * (Sys.WORD_SIZE == 64 ? "64_" : ""))
721+
@test 23.0 === @ccall $(dot_sym)(2::Cint, [2.0, 3.0]::Ref{Cdouble}, 1::Cint, [4.0, 5.0]::Ref{Cdouble}, 1::Cint)::Cdouble
722+
end
723+
716724
end # module TestBLAS

0 commit comments

Comments
 (0)