Skip to content

Commit d57f5f5

Browse files
committed
Fix lazy codegen test.
1 parent b8cf0a4 commit d57f5f5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/native.jl

+6-6
Original file line numberDiff line numberDiff line change
@@ -284,18 +284,18 @@ end
284284
@testset "LazyCodegen" begin
285285
import .LazyCodegen: call_delayed
286286

287-
global flag = Ref(false) # otherwise f is a closure and we can't
288-
# pass it to `Val`...
289-
f() = (flag[]=true; nothing)
287+
f(A) = (A[] += 42; nothing)
290288

289+
global flag = [0]
291290
function caller()
292-
call_delayed(f)
291+
call_delayed(f, flag::Vector{Int})
293292
end
294293
@test caller() === nothing
295-
@test flag[]
294+
@test flag[] == 42
296295

297296
ir = sprint(io->native_code_llvm(io, caller, Tuple{}, dump_module=true))
298-
@test occursin(r"define void @julia_f_\d+", ir)
297+
@test occursin(r"add i64 %\d+, 42", ir)
298+
# NOTE: can't just look for `jl_f` here, since it may be inlined and optimized away.
299299

300300
add(x, y) = x+y
301301
function call_add(x, y)

0 commit comments

Comments
 (0)