From 7d3cbb3e9365b9a26df1dbbd812dd37a7cf2a757 Mon Sep 17 00:00:00 2001 From: Oneirical Date: Mon, 15 Jul 2024 14:02:03 -0400 Subject: [PATCH] rewrite staticlib-blank-lib to rmake --- src/tools/tidy/src/allowed_run_make_makefiles.txt | 1 - tests/run-make/staticlib-blank-lib/Makefile | 6 ------ tests/run-make/staticlib-blank-lib/rmake.rs | 13 +++++++++++++ 3 files changed, 13 insertions(+), 7 deletions(-) delete mode 100644 tests/run-make/staticlib-blank-lib/Makefile create mode 100644 tests/run-make/staticlib-blank-lib/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 745f00c4f52..7fffe7c6ea5 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -102,7 +102,6 @@ run-make/simd-ffi/Makefile run-make/split-debuginfo/Makefile run-make/stable-symbol-names/Makefile run-make/static-dylib-by-default/Makefile -run-make/staticlib-blank-lib/Makefile run-make/staticlib-dylib-linkage/Makefile run-make/symbol-mangling-hashed/Makefile run-make/symbol-visibility/Makefile diff --git a/tests/run-make/staticlib-blank-lib/Makefile b/tests/run-make/staticlib-blank-lib/Makefile deleted file mode 100644 index fcbf87758fb..00000000000 --- a/tests/run-make/staticlib-blank-lib/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -include ../tools.mk - -all: - $(AR) crus $(TMPDIR)/libfoo.a foo.rs - $(AR) d $(TMPDIR)/libfoo.a foo.rs - $(RUSTC) foo.rs diff --git a/tests/run-make/staticlib-blank-lib/rmake.rs b/tests/run-make/staticlib-blank-lib/rmake.rs new file mode 100644 index 00000000000..11a85d102aa --- /dev/null +++ b/tests/run-make/staticlib-blank-lib/rmake.rs @@ -0,0 +1,13 @@ +// In this test, the static library foo is made blank, which used to cause +// a compilation error. As the compiler now returns Ok upon encountering a blank +// staticlib as of #12379, this test checks that compilation is successful despite +// the blank staticlib. +// See https://github.com/rust-lang/rust/pull/12379 + +use run_make_support::{llvm_ar, rustc, static_lib_name}; + +fn main() { + llvm_ar().obj_to_ar().output_input(static_lib_name("foo"), "foo.rs").run(); + llvm_ar().arg("d").output_input(static_lib_name("foo"), "foo.rs").run(); + rustc().input("foo.rs").run(); +}