File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -284,18 +284,18 @@ end
284
284
@testset " LazyCodegen" begin
285
285
import . LazyCodegen: call_delayed
286
286
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 )
290
288
289
+ global flag = [0 ]
291
290
function caller ()
292
- call_delayed (f)
291
+ call_delayed (f, flag :: Vector{Int} )
293
292
end
294
293
@test caller () === nothing
295
- @test flag[]
294
+ @test flag[] == 42
296
295
297
296
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.
299
299
300
300
add (x, y) = x+ y
301
301
function call_add (x, y)
You can’t perform that action at this time.
0 commit comments