Skip to content

Commit

Permalink
Don't run ccall test on platforms that don't allow it
Browse files Browse the repository at this point in the history
  • Loading branch information
giordano committed Jun 1, 2021
1 parent 7130415 commit 7132f54
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -732,11 +732,15 @@ end
@testset "2-arg functions: $f" for f in (log, hypot, atan)
@test @uncertain(f(x, y)) f(x, y)
end
@testset "ccall" begin
f(x) = x * x
ptr = @cfunction($f, Cdouble, (Cdouble,))
g(x) = ccall(Base.unsafe_convert(Ptr{Cvoid}, ptr), Cdouble, (Cdouble,), x)*x
@test GC.@preserve(ptr, @uncertain(g(x))) x^3
@static if Base.BinaryPlatforms.arch(Base.BinaryPlatforms.HostPlatform()) ("aarch64", "armv6l", "armv7l", "powerpc64le")
# Don't run this test if the platform doesn't allow it, see
# https://github.com/JuliaLang/julia/blob/58ffe7e3ed3a93a9d816097548e785284f57fbd4/src/codegen.cpp#L5531-L5536
@testset "ccall" begin
f(x) = x * x
ptr = @cfunction($f, Cdouble, (Cdouble,))
g(x) = ccall(Base.unsafe_convert(Ptr{Cvoid}, ptr), Cdouble, (Cdouble,), x)*x
@test GC.@preserve(ptr, @uncertain(g(x))) x^3
end
end
end

Expand Down

0 comments on commit 7132f54

Please sign in to comment.