diff --git a/base/c.jl b/base/c.jl index 05bb07a4165d9..91337f0a242a5 100644 --- a/base/c.jl +++ b/base/c.jl @@ -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 diff --git a/test/ccall.jl b/test/ccall.jl index 2cc61e2c25271..1332e39a4e758 100644 --- a/test/ccall.jl +++ b/test/ccall.jl @@ -1970,7 +1970,7 @@ 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, ()) @@ -1978,6 +1978,7 @@ let llvm = sprint(code_llvm, gc_safe_ccall, ()) @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