Skip to content

Commit fb2e491

Browse files
committed
Remove test calling intrinsic with invalid arguments.
llvmcall on 1.9 refuses these invocations.
1 parent c85028f commit fb2e491

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

test/interop.jl

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -246,23 +246,14 @@ end
246246
@testset "type-preserving ccall" begin
247247
# NOTE: the auto-upgrader will remangle these intrinsics, but only if they were
248248
# specified in the first place (`if Name.startswith("ptr.annotation.")`)
249-
bad(ptr::Ptr{T}) where {T} = ccall("llvm.ptr.annotation.p0i64", llvmcall, Ptr{T}, (Ptr{T}, Ptr{Int8}, Ptr{Int8}, Int32), ptr, C_NULL, C_NULL, 0)
250-
good(ptr::Ptr{T}) where {T} = @typed_ccall("llvm.ptr.annotation.p0i64", llvmcall, Ptr{T}, (Ptr{T}, Ptr{Int8}, Ptr{Int8}, Int32), ptr, C_NULL, C_NULL, 0)
249+
annotated(ptr::Ptr{T}) where {T} = @typed_ccall("llvm.ptr.annotation.p0i64", llvmcall, Ptr{T}, (Ptr{T}, Ptr{Int8}, Ptr{Int8}, Int32), ptr, C_NULL, C_NULL, 0)
251250

252-
ir = sprint(io->code_llvm(io, bad, Tuple{Ptr{Float64}}))
253-
@test occursin("i64 @llvm.ptr.annotation.p0i64(i64", ir)
254-
255-
ir = sprint(io->code_llvm(io, good, Tuple{Ptr{Float64}}))
251+
ir = sprint(io->code_llvm(io, annotated, Tuple{Ptr{Float64}}))
256252
@test occursin("double* @llvm.ptr.annotation.p0f64(double*", ir)
257253

258-
bad(ptr::LLVMPtr{T}) where {T} = ccall("llvm.ptr.annotation.p0i64", llvmcall, LLVMPtr{T,1}, (LLVMPtr{T,1}, Ptr{Int8}, Ptr{Int8}, Int32), ptr, C_NULL, C_NULL, 0)
259-
good(ptr::LLVMPtr{T}) where {T} = @typed_ccall("llvm.ptr.annotation.p0i64", llvmcall, LLVMPtr{T,1}, (LLVMPtr{T,1}, Ptr{Int8}, Ptr{Int8}, Int32), ptr, C_NULL, C_NULL, 0)
260-
261-
ir = sprint(io->code_llvm(io, bad, Tuple{LLVMPtr{Float64,1}}))
262-
# XXX: why isn't this remangled to p1i8? and why doesn't it currently assert somewhere?
263-
@test occursin("i8 addrspace(1)* @llvm.ptr.annotation.p0i64(i8 addrspace(1)*", ir)
254+
annotated(ptr::LLVMPtr{T}) where {T} = @typed_ccall("llvm.ptr.annotation.p0i64", llvmcall, LLVMPtr{T,1}, (LLVMPtr{T,1}, Ptr{Int8}, Ptr{Int8}, Int32), ptr, C_NULL, C_NULL, 0)
264255

265-
ir = sprint(io->code_llvm(io, good, Tuple{LLVMPtr{Float64,1}}))
256+
ir = sprint(io->code_llvm(io, annotated, Tuple{LLVMPtr{Float64,1}}))
266257
@test occursin("double addrspace(1)* @llvm.ptr.annotation.p1f64(double addrspace(1)*", ir)
267258

268259
# test return nothing

0 commit comments

Comments
 (0)