From d9d013bec077600b8b0dc25e51191802d1e11cd9 Mon Sep 17 00:00:00 2001 From: Oneirical Date: Mon, 27 May 2024 20:57:01 -0400 Subject: [PATCH] rewrite lto-smoke to rmake --- .../tidy/src/allowed_run_make_makefiles.txt | 1 - tests/run-make/lto-smoke/Makefile | 31 ------------------- tests/run-make/lto-smoke/rmake.rs | 13 ++++++++ 3 files changed, 13 insertions(+), 32 deletions(-) delete mode 100644 tests/run-make/lto-smoke/Makefile create mode 100644 tests/run-make/lto-smoke/rmake.rs diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index 2329b8b44de..baf341277c7 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -145,7 +145,6 @@ run-make/lto-linkage-used-attr/Makefile run-make/lto-no-link-whole-rlib/Makefile run-make/lto-readonly-lib/Makefile run-make/lto-smoke-c/Makefile -run-make/lto-smoke/Makefile run-make/macos-deployment-target/Makefile run-make/macos-fat-archive/Makefile run-make/manual-crate-name/Makefile diff --git a/tests/run-make/lto-smoke/Makefile b/tests/run-make/lto-smoke/Makefile deleted file mode 100644 index 13a09fce734..00000000000 --- a/tests/run-make/lto-smoke/Makefile +++ /dev/null @@ -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) - diff --git a/tests/run-make/lto-smoke/rmake.rs b/tests/run-make/lto-smoke/rmake.rs new file mode 100644 index 00000000000..7294c32fbf8 --- /dev/null +++ b/tests/run-make/lto-smoke/rmake.rs @@ -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(); + } +}