Skip to content

Commit

Permalink
Add test for use of Base.libblas_name
Browse files Browse the repository at this point in the history
  • Loading branch information
giordano committed Feb 3, 2023
1 parent f2d7055 commit a93ac54
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions stdlib/LinearAlgebra/test/blas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module TestBLAS

using Test, LinearAlgebra, Random
using LinearAlgebra: BlasReal, BlasComplex
using Libdl: dlsym, dlopen
fabs(x::Real) = abs(x)
fabs(x::Complex) = abs(real(x)) + abs(imag(x))

Expand Down Expand Up @@ -713,4 +714,11 @@ end
end
end

# Make sure we can use `Base.libblas_name`. Avoid causing
# https://github.com/JuliaLang/julia/issues/48427 again.
@testset "libblas_name" begin
dot_sym = dlsym(dlopen(Base.libblas_name), "cblas_ddot" * (Sys.WORD_SIZE == 64 ? "64_" : ""))
@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
end

end # module TestBLAS

0 comments on commit a93ac54

Please sign in to comment.