rewrite compiler-lookup-paths-2 to rmake

This commit is contained in:
Oneirical 2024-07-19 15:00:10 -04:00
parent 27334943ed
commit 2192a916d4
4 changed files with 21 additions and 12 deletions

View File

@ -6,7 +6,6 @@ run-make/c-static-rlib/Makefile
run-make/c-unwind-abi-catch-lib-panic/Makefile run-make/c-unwind-abi-catch-lib-panic/Makefile
run-make/cat-and-grep-sanity-check/Makefile run-make/cat-and-grep-sanity-check/Makefile
run-make/cdylib-dylib-linkage/Makefile run-make/cdylib-dylib-linkage/Makefile
run-make/compiler-lookup-paths-2/Makefile
run-make/compiler-rt-works-on-mingw/Makefile run-make/compiler-rt-works-on-mingw/Makefile
run-make/crate-hash-rustc-version/Makefile run-make/crate-hash-rustc-version/Makefile
run-make/cross-lang-lto-clang/Makefile run-make/cross-lang-lto-clang/Makefile

View File

@ -1,11 +0,0 @@
# This test checks that extern crate declarations in Cargo without a corresponding declaration in the manifest of a dependency are NOT allowed.
# See https://github.com/rust-lang/rust/pull/21113
include ../tools.mk
all:
mkdir -p $(TMPDIR)/a $(TMPDIR)/b
$(RUSTC) a.rs && mv $(TMPDIR)/liba.rlib $(TMPDIR)/a
$(RUSTC) b.rs -L $(TMPDIR)/a && mv $(TMPDIR)/libb.rlib $(TMPDIR)/b
$(RUSTC) c.rs -L crate=$(TMPDIR)/b -L dependency=$(TMPDIR)/a \
&& exit 1 || exit 0

View File

@ -0,0 +1,20 @@
// This test checks that extern crate declarations in Cargo without a corresponding declaration
// in the manifest of a dependency are NOT allowed. The last rustc call does it anyways, which
// should result in a compilation failure.
// See https://github.com/rust-lang/rust/pull/21113
use run_make_support::{path, rfs, rust_lib_name, rustc};
fn main() {
rfs::create_dir("a");
rfs::create_dir("b");
rustc().input("a.rs").run();
rfs::rename(rust_lib_name("a"), path("a").join(rust_lib_name("a")));
rustc().input("b.rs").library_search_path("a").run();
rfs::rename(rust_lib_name("b"), path("b").join(rust_lib_name("b")));
rustc()
.input("c.rs")
.library_search_path("crate=b")
.library_search_path("dependency=a")
.run_fail();
}

View File

@ -13,6 +13,7 @@
use run_make_support::{run, run_with_args, rustc}; use run_make_support::{run, run_with_args, rustc};
fn main() { fn main() {
// Smoke-test that #[bench] isn't entirely broken.
rustc().arg("--test").input("smokebench.rs").opt().run(); rustc().arg("--test").input("smokebench.rs").opt().run();
run_with_args("smokebench", &["--bench"]); run_with_args("smokebench", &["--bench"]);
run_with_args("smokebench", &["--bench", "noiter"]); run_with_args("smokebench", &["--bench", "noiter"]);