rewrite lto-empty to rmake

This commit is contained in:
Oneirical 2024-06-25 14:27:43 -04:00
parent c290e9de32
commit 6ba0a84df9
3 changed files with 17 additions and 14 deletions

View file

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

View file

@ -1,13 +0,0 @@
# ignore-cross-compile
include ../tools.mk
all: cdylib-fat cdylib-thin
cdylib-fat:
$(RUSTC) lib.rs -C lto=fat -C opt-level=3 -C incremental=$(TMPDIR)/inc-fat
$(RUSTC) lib.rs -C lto=fat -C opt-level=3 -C incremental=$(TMPDIR)/inc-fat
cdylib-thin:
$(RUSTC) lib.rs -C lto=thin -C opt-level=3 -C incremental=$(TMPDIR)/inc-thin
$(RUSTC) lib.rs -C lto=thin -C opt-level=3 -C incremental=$(TMPDIR)/inc-thin

View file

@ -0,0 +1,17 @@
// Compiling Rust code twice in a row with "fat" link-time-optimizations used to cause
// an internal compiler error (ICE). This was due to how the compiler would cache some modules
// to make subsequent compilations faster, at least one of which was required for LTO to link
// into. After this was patched in #63956, this test checks that the bug does not make
// a resurgence.
// See https://github.com/rust-lang/rust/issues/63349
//@ ignore-cross-compile
use run_make_support::rustc;
fn main() {
rustc().input("lib.rs").arg("-Clto=fat").opt_level("3").incremental("inc-fat").run();
rustc().input("lib.rs").arg("-Clto=fat").opt_level("3").incremental("inc-fat").run();
rustc().input("lib.rs").arg("-Clto=thin").opt_level("3").incremental("inc-thin").run();
rustc().input("lib.rs").arg("-Clto=thin").opt_level("3").incremental("inc-thin").run();
}