From cb799b8784d26a9260b4aab7cc871b8392731d0c Mon Sep 17 00:00:00 2001 From: woclass Date: Sat, 16 Jul 2022 12:57:51 +0800 Subject: [PATCH 1/2] test: fix codegen debug lib name --- test/compiler/codegen.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/compiler/codegen.jl b/test/compiler/codegen.jl index c13ac2ad5255b..587549ff2cefd 100644 --- a/test/compiler/codegen.jl +++ b/test/compiler/codegen.jl @@ -675,10 +675,14 @@ U41096 = Term41096{:U}(Modulate41096(:U, false)) @test !newexpand41096((t=t41096, μ=μ41096, U=U41096), :U) +function libjulia_codegen_name() + (ccall(:jl_is_debugbuild, Cint, ()) != 0) ? "libjulia-codegen-debug" : "libjulia-codegen" +end + # test that we can start julia with libjulia-codegen removed; PR #41936 mktempdir() do pfx cp(dirname(Sys.BINDIR), pfx; force=true) - libpath = relpath(dirname(dlpath("libjulia-codegen")), dirname(Sys.BINDIR)) + libpath = relpath(dirname(dlpath(libjulia_codegen_name())), dirname(Sys.BINDIR)) libs_deleted = 0 for f in filter(f -> startswith(f, "libjulia-codegen"), readdir(joinpath(pfx, libpath))) rm(joinpath(pfx, libpath, f); force=true, recursive=true) From 74b7ae870a128e335b44e7f2b6ea508f4a7bfb8b Mon Sep 17 00:00:00 2001 From: woclass Date: Sat, 16 Jul 2022 13:04:43 +0800 Subject: [PATCH 2/2] test: skip some codegen tests in debug version --- test/compiler/codegen.jl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/compiler/codegen.jl b/test/compiler/codegen.jl index 587549ff2cefd..74938e5d635ca 100644 --- a/test/compiler/codegen.jl +++ b/test/compiler/codegen.jl @@ -10,11 +10,16 @@ const opt_level = Base.JLOptions().opt_level const coverage = (Base.JLOptions().code_coverage > 0) || (Base.JLOptions().malloc_log > 0) const Iptr = sizeof(Int) == 8 ? "i64" : "i32" +const is_debug_build = ccall(:jl_is_debugbuild, Cint, ()) != 0 +function libjulia_codegen_name() + is_debug_build ? "libjulia-codegen-debug" : "libjulia-codegen" +end + # `_dump_function` might be more efficient but it doesn't really matter here... get_llvm(@nospecialize(f), @nospecialize(t), raw=true, dump_module=false, optimize=true) = sprint(code_llvm, f, t, raw, dump_module, optimize) -if opt_level > 0 +if !is_debug_build && opt_level > 0 # Make sure getptls call is removed at IR level with optimization on @test !occursin(" call ", get_llvm(identity, Tuple{String})) end @@ -104,7 +109,7 @@ function test_jl_dump_llvm_opt() end end -if opt_level > 0 +if !is_debug_build && opt_level > 0 # Make sure `jl_string_ptr` is inlined @test !occursin(" call ", get_llvm(jl_string_ptr, Tuple{String})) # Make sure `Core.sizeof` call is inlined @@ -675,9 +680,6 @@ U41096 = Term41096{:U}(Modulate41096(:U, false)) @test !newexpand41096((t=t41096, μ=μ41096, U=U41096), :U) -function libjulia_codegen_name() - (ccall(:jl_is_debugbuild, Cint, ()) != 0) ? "libjulia-codegen-debug" : "libjulia-codegen" -end # test that we can start julia with libjulia-codegen removed; PR #41936 mktempdir() do pfx