/
githubmirror
/
julia
Обзор
Документация
Войти
/
githubmirror
/
julia
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Compiler/extras/CompilerDevTools/test/runtests.jl
24 строки
860 B
Shuhei Kadowaki
Compiler.jl: gitignore CompilerDevTools/Manifest.toml (#61266)
11 мар 2026, 12:14
Не верифицирован
11 мар 2026, 12:14
3b680c3
Код
Авторство
О чём код?
using Test using Compiler: code_cache using Base: inferencebarrier using CompilerDevTools using CompilerDevTools: SplitCacheInterp, lookup_method_instance @testset "CompilerDevTools" begin do_work(x, y) = x + y f1() = do_work(inferencebarrier(1), inferencebarrier(2)) interp = SplitCacheInterp() cache = code_cache(interp) mi = lookup_method_instance(f1) @test !haskey(cache, mi) @test with_new_compiler(f1, interp.owner) === 3 @test haskey(cache, mi) # Here `do_work` is compiled at runtime, and so must have # required extra work to be cached under the same cache owner. mi = lookup_method_instance(do_work, 1, 2) @test haskey(cache, mi) # Should not error with a builtin whose type we do not know f_unknown_builtin() = Base.compilerbarrier(:type, isa)(1, Int) with_new_compiler(f_unknown_builtin, interp.owner) === true end;