rewrite lto-dylib-dep to rmake

This commit is contained in:
Oneirical 2024-06-26 13:32:30 -04:00
parent a6bb92ada7
commit c6bb357502
3 changed files with 15 additions and 12 deletions

View File

@ -94,7 +94,6 @@ run-make/llvm-ident/Makefile
run-make/long-linker-command-lines-cmd-exe/Makefile run-make/long-linker-command-lines-cmd-exe/Makefile
run-make/long-linker-command-lines/Makefile run-make/long-linker-command-lines/Makefile
run-make/longjmp-across-rust/Makefile run-make/longjmp-across-rust/Makefile
run-make/lto-dylib-dep/Makefile
run-make/lto-linkage-used-attr/Makefile run-make/lto-linkage-used-attr/Makefile
run-make/lto-no-link-whole-rlib/Makefile run-make/lto-no-link-whole-rlib/Makefile
run-make/lto-smoke-c/Makefile run-make/lto-smoke-c/Makefile

View File

@ -1,11 +0,0 @@
# ignore-cross-compile
include ../tools.mk
# Test that we don't run into an assertion when using a Rust dylib dependency
# while compiling with full LTO.
# See https://github.com/rust-lang/rust/issues/59137
all:
$(RUSTC) a_dylib.rs --crate-type=dylib -C prefer-dynamic
$(RUSTC) main.rs -C lto
$(call RUN,main)

View File

@ -0,0 +1,15 @@
// Compiling with link-time-optimizations (LTO) would previously run into an internal
// compiler error (ICE) if a dylib was passed as a required library. This was due to a
// misplaced assert! call in the compiler, which is now removed. This test checks that
// this bug does not make a resurgence and that dylib+lto compilation succeeds.
// See https://github.com/rust-lang/rust/issues/59137
//@ ignore-cross-compile
use run_make_support::{run, rustc};
fn main() {
rustc().input("a_dylib.rs").crate_type("dylib").arg("-Cprefer-dynamic").run();
rustc().input("main.rs").arg("-Clto").run();
run("main");
}