From cc97376adeba686f6d1e1d77c290a02d9d688a68 Mon Sep 17 00:00:00 2001 From: Oneirical Date: Mon, 27 May 2024 21:19:58 -0400 Subject: [PATCH] Rewrite simple-rlib to rmake --- src/tools/tidy/src/allowed_run_make_makefiles.txt | 1 - tests/run-make/lto-smoke/rmake.rs | 7 ++++--- .../{mixing-formats => mixing-deps}/rmake.rs | 0 tests/run-make/simple-rlib/Makefile | 6 ------ tests/run-make/simple-rlib/bar.rs | 1 - tests/run-make/simple-rlib/foo.rs | 5 ----- tests/ui/imports/auxiliary/simple-rlib.rs | 2 ++ tests/ui/imports/simple-rlib-import.rs | 12 ++++++++++++ 8 files changed, 18 insertions(+), 16 deletions(-) rename tests/run-make/{mixing-formats => mixing-deps}/rmake.rs (100%) delete mode 100644 tests/run-make/simple-rlib/Makefile delete mode 100644 tests/run-make/simple-rlib/bar.rs delete mode 100644 tests/run-make/simple-rlib/foo.rs create mode 100644 tests/ui/imports/auxiliary/simple-rlib.rs create mode 100644 tests/ui/imports/simple-rlib-import.rs diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index 6d79711e686..7ad5dec8a84 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -237,7 +237,6 @@ run-make/short-ice/Makefile run-make/silly-file-names/Makefile run-make/simd-ffi/Makefile run-make/simple-dylib/Makefile -run-make/simple-rlib/Makefile run-make/split-debuginfo/Makefile run-make/stable-symbol-names/Makefile run-make/static-dylib-by-default/Makefile diff --git a/tests/run-make/lto-smoke/rmake.rs b/tests/run-make/lto-smoke/rmake.rs index c0f181c1082..692945135cd 100644 --- a/tests/run-make/lto-smoke/rmake.rs +++ b/tests/run-make/lto-smoke/rmake.rs @@ -1,5 +1,6 @@ // A simple smoke test to check that link time optimization -// (LTO) works as intended, with its various flags turned on. +// (LTO) is accepted by the compiler, and that +// passing its various flags still results in successful compilation. // See https://github.com/rust-lang/rust/issues/10741 //@ ignore-cross-compile @@ -9,7 +10,7 @@ use run_make_support::rustc; 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(); + rustc().input("lib.rs").run(); + rustc().input("main.rs").arg(flag).run(); } } diff --git a/tests/run-make/mixing-formats/rmake.rs b/tests/run-make/mixing-deps/rmake.rs similarity index 100% rename from tests/run-make/mixing-formats/rmake.rs rename to tests/run-make/mixing-deps/rmake.rs diff --git a/tests/run-make/simple-rlib/Makefile b/tests/run-make/simple-rlib/Makefile deleted file mode 100644 index 28df61a1547..00000000000 --- a/tests/run-make/simple-rlib/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# ignore-cross-compile -include ../tools.mk -all: - $(RUSTC) bar.rs --crate-type=rlib - $(RUSTC) foo.rs - $(call RUN,foo) diff --git a/tests/run-make/simple-rlib/bar.rs b/tests/run-make/simple-rlib/bar.rs deleted file mode 100644 index c5c0bc606cd..00000000000 --- a/tests/run-make/simple-rlib/bar.rs +++ /dev/null @@ -1 +0,0 @@ -pub fn bar() {} diff --git a/tests/run-make/simple-rlib/foo.rs b/tests/run-make/simple-rlib/foo.rs deleted file mode 100644 index 8d68535e3b6..00000000000 --- a/tests/run-make/simple-rlib/foo.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate bar; - -fn main() { - bar::bar(); -} diff --git a/tests/ui/imports/auxiliary/simple-rlib.rs b/tests/ui/imports/auxiliary/simple-rlib.rs new file mode 100644 index 00000000000..28a6273840f --- /dev/null +++ b/tests/ui/imports/auxiliary/simple-rlib.rs @@ -0,0 +1,2 @@ +#![crate_type = "rlib"] +pub fn bar() {} diff --git a/tests/ui/imports/simple-rlib-import.rs b/tests/ui/imports/simple-rlib-import.rs new file mode 100644 index 00000000000..6eab7ba04cf --- /dev/null +++ b/tests/ui/imports/simple-rlib-import.rs @@ -0,0 +1,12 @@ +// A simple test, where foo.rs has a dependency +// on the rlib (a static Rust-specific library format) bar.rs. If the test passes, +// rlibs can be built and linked into another file successfully.. + +//@ aux-crate:bar=simple-rlib.rs +//@ run-pass + +extern crate bar; + +fn main() { + bar::bar(); +}