File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -480,20 +480,18 @@ function test_allocations_rewrite_unary_minus()
480480 MA. @rewrite (- sum (x[i] for i in 1 : N), move_factors_into_sums = false )
481481 MA. @rewrite (sum (a * x[i] for i in 1 : N), move_factors_into_sums = false )
482482 sum (- x[i] for i in 1 : N)
483- total = @allocated sum (- x[i] for i in 1 : N)
484- # actual
485483 value = @allocated (
486484 MA. @rewrite (sum (- x[i] for i in 1 : N), move_factors_into_sums = false ),
487485 )
488- @test value < total
486+ @test value < @allocated sum ( - x[i] for i in 1 : N)
489487 value = @allocated (
490488 MA. @rewrite (- sum (x[i] for i in 1 : N), move_factors_into_sums = false ),
491489 )
492- @test value < total
490+ @test value < @allocated - sum (x[i] for i in 1 : N)
493491 value = @allocated (
494492 MA. @rewrite (sum (a * x[i] for i in 1 : N), move_factors_into_sums = false ),
495493 )
496- @test value < total
494+ @test value < @allocated sum (a * x[i] for i in 1 : N)
497495 return
498496end
499497
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ include("dummy.jl")
1010# v1.12.5 off by 8
1111_big_int_alloc () = @allocated (BigInt (1 ))
1212
13- function alloc_test (f, expected_upper_bound)
13+ function alloc_test (f:: F , expected_upper_bound:: Int ) where {F <: Function }
1414 f () # compile
1515 measured_allocations = @allocated f ()
1616 @test measured_allocations <= expected_upper_bound
You can’t perform that action at this time.
0 commit comments