From 189232bc42b7c66d1f75a40a806680b3935f96ca Mon Sep 17 00:00:00 2001 From: Jerry Wang Date: Sun, 23 Jun 2024 16:41:36 -0400 Subject: [PATCH] Migrate `wasm-override-linker` to `rmake` --- .../tidy/src/allowed_run_make_makefiles.txt | 1 - tests/run-make/wasm-override-linker/Makefile | 16 ---------------- tests/run-make/wasm-override-linker/rmake.rs | 17 +++++++++++++++++ 3 files changed, 17 insertions(+), 17 deletions(-) delete mode 100644 tests/run-make/wasm-override-linker/Makefile create mode 100644 tests/run-make/wasm-override-linker/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 f7e1aeb7527..2ab97c3c437 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -187,5 +187,4 @@ run-make/translation/Makefile run-make/type-mismatch-same-crate-name/Makefile run-make/unstable-flag-required/Makefile run-make/wasm-exceptions-nostd/Makefile -run-make/wasm-override-linker/Makefile run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile diff --git a/tests/run-make/wasm-override-linker/Makefile b/tests/run-make/wasm-override-linker/Makefile deleted file mode 100644 index 1a01a574dee..00000000000 --- a/tests/run-make/wasm-override-linker/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# needs-force-clang-based-tests - -# FIXME(#126180): This test doesn't actually run anywhere, because the only -# CI job that sets RUSTBUILD_FORCE_CLANG_BASED_TESTS runs very few tests. - -include ../tools.mk - -ifeq ($(TARGET),wasm32-unknown-unknown) -all: - $(RUSTC) foo.rs --crate-type cdylib --target $(TARGET) -C linker=$(CLANG) -else ifeq ($(TARGET),wasm64-unknown-unknown) -all: - $(RUSTC) foo.rs --crate-type cdylib --target $(TARGET) -C linker=$(CLANG) -else -all: -endif diff --git a/tests/run-make/wasm-override-linker/rmake.rs b/tests/run-make/wasm-override-linker/rmake.rs new file mode 100644 index 00000000000..01bc08e9901 --- /dev/null +++ b/tests/run-make/wasm-override-linker/rmake.rs @@ -0,0 +1,17 @@ +// How to run this +// $ RUSTBUILD_FORCE_CLANG_BASED_TESTS=1 ./x.py test tests/run-make/wasm-override-linker/ + +//@ needs-force-clang-based-tests + +use run_make_support::{env_var, rustc, target}; + +fn main() { + if matches!(target().as_str(), "wasm32-unknown-unknown" | "wasm64-unknown-unknown") { + rustc() + .input("foo.rs") + .crate_type("cdylib") + .target(&target()) + .linker(&env_var("CLANG")) + .run(); + } +}