rewrite lto-smoke to rmake

This commit is contained in:
Oneirical 2024-05-27 20:57:01 -04:00
parent 84b40fc908
commit d9d013bec0
3 changed files with 13 additions and 32 deletions

View File

@ -145,7 +145,6 @@ 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-readonly-lib/Makefile run-make/lto-readonly-lib/Makefile
run-make/lto-smoke-c/Makefile run-make/lto-smoke-c/Makefile
run-make/lto-smoke/Makefile
run-make/macos-deployment-target/Makefile run-make/macos-deployment-target/Makefile
run-make/macos-fat-archive/Makefile run-make/macos-fat-archive/Makefile
run-make/manual-crate-name/Makefile run-make/manual-crate-name/Makefile

View File

@ -1,31 +0,0 @@
# ignore-cross-compile
include ../tools.mk
all: noparam bool_true bool_false thin fat
noparam:
$(RUSTC) lib.rs
$(RUSTC) main.rs -C lto
$(call RUN,main)
bool_true:
$(RUSTC) lib.rs
$(RUSTC) main.rs -C lto=yes
$(call RUN,main)
bool_false:
$(RUSTC) lib.rs
$(RUSTC) main.rs -C lto=off
$(call RUN,main)
thin:
$(RUSTC) lib.rs
$(RUSTC) main.rs -C lto=thin
$(call RUN,main)
fat:
$(RUSTC) lib.rs
$(RUSTC) main.rs -C lto=fat
$(call RUN,main)

View File

@ -0,0 +1,13 @@
// A simple smoke test to check that link time optimization
// (LTO) works as intended, with its various flags turned on.
// See https://github.com/rust-lang/rust/issues/10741
//@ ignore-cross-compile
fn main() {
let lto_flags = ["-Clto", "-Clto=yes", "-Clto=off", "-Clto=thin", "-Clto=fat"];
for flag in lto_flags {
rustc().input(lib.rs).run();
rustc().input(main.rs).arg(flag).run();
}
}