Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions base/c.jl
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,6 @@ macro ccall(exprs...)
return ccall_macro_lower((:ccall), ccall_macro_parse(exprs)...)
end

macro ccall_effects(effects::UInt16, expr)
return ccall_macro_lower((:ccall, effects), ccall_macro_parse(expr)...)
macro ccall_effects(effects::UInt16, exprs...)
return ccall_macro_lower((:ccall, effects), ccall_macro_parse(exprs)...)
end
3 changes: 2 additions & 1 deletion test/ccall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1970,14 +1970,15 @@ end

function gc_safe_ccall()
# jl_rand is marked as JL_NOTSAFEPOINT
@ccall gc_safe=true jl_rand()::UInt64
Base.@assume_effects :nothrow @ccall gc_safe=true jl_rand()::UInt64
end

let llvm = sprint(code_llvm, gc_safe_ccall, ())
# check that the call works
@test gc_safe_ccall() isa UInt64
# check for the gc_safe store
@test occursin("store atomic i8 2", llvm)
@test Base.infer_effects(gc_safe_ccall, Tuple{}).nothrow == true
end

@testset "jl_dlfind and dlsym" begin
Expand Down