@@ -3005,14 +3005,14 @@ end
3005
3005
# Some very limited testing of timing the type inference (#37749).
3006
3006
@testset " Core.Compiler.Timings" begin
3007
3007
# Functions that call each other
3008
- @eval module M
3008
+ @eval module M1
3009
3009
i (x) = x+ 5
3010
3010
i2 (x) = x+ 2
3011
3011
h (a:: Array ) = i2 (a[1 ]:: Integer ) + i (a[1 ]:: Integer ) + 2
3012
3012
g (y:: Integer , x) = h (Any[y]) + Int (x)
3013
3013
end
3014
3014
timing1 = time_inference () do
3015
- @eval M . g (2 , 3.0 )
3015
+ @eval M1 . g (2 , 3.0 )
3016
3016
end
3017
3017
@test occursin (r" Core.Compiler.Timings.Timing\( InferenceFrameInfo for Core.Compiler.Timings.ROOT\(\)\) with \d + children" , sprint (show, timing1))
3018
3018
# The last two functions to be inferred should be `i` and `i2`, inferred at runtime with
@@ -3024,11 +3024,11 @@ end
3024
3024
@test isa (stacktrace (timing1. children[1 ]. bt), Vector{Base. StackTraces. StackFrame})
3025
3025
# Test that inference has cached some of the Method Instances
3026
3026
timing2 = time_inference () do
3027
- @eval M . g (2 , 3.0 )
3027
+ @eval M1 . g (2 , 3.0 )
3028
3028
end
3029
3029
@test length (flatten_times (timing2)) < length (flatten_times (timing1))
3030
3030
# Printing of InferenceFrameInfo for mi.def isa Module
3031
- @eval module M
3031
+ @eval module M2
3032
3032
i (x) = x+ 5
3033
3033
i2 (x) = x+ 2
3034
3034
h (a:: Array ) = i2 (a[1 ]:: Integer ) + i (a[1 ]:: Integer ) + 2
@@ -3038,7 +3038,7 @@ end
3038
3038
timingmod = time_inference () do
3039
3039
@eval @testset " Outer" begin
3040
3040
@testset " Inner" begin
3041
- for i = 1 : 2 M . g (2 , 3.0 ) end
3041
+ for i = 1 : 2 M2 . g (2 , 3.0 ) end
3042
3042
end
3043
3043
end
3044
3044
end
0 commit comments