diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index 07073ef5d40..7c882d3ce15 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -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 diff --git a/tests/run-make/lto-empty/Makefile b/tests/run-make/lto-empty/Makefile deleted file mode 100644 index 1b795c4b738..00000000000 --- a/tests/run-make/lto-empty/Makefile +++ /dev/null @@ -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 - diff --git a/tests/run-make/lto-empty/rmake.rs b/tests/run-make/lto-empty/rmake.rs new file mode 100644 index 00000000000..7146d6e10ef --- /dev/null +++ b/tests/run-make/lto-empty/rmake.rs @@ -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(); +}