rewrite invalid-staticlib to rmake

This commit is contained in:
Oneirical 2024-06-13 16:19:59 -04:00
parent ff82e43ca3
commit cabc982253
3 changed files with 17 additions and 7 deletions

View File

@ -75,7 +75,6 @@ run-make/interdependent-c-libraries/Makefile
run-make/intrinsic-unreachable/Makefile
run-make/invalid-library/Makefile
run-make/invalid-so/Makefile
run-make/invalid-staticlib/Makefile
run-make/issue-107094/Makefile
run-make/issue-10971-temps-dir/Makefile
run-make/issue-109934-lto-debuginfo/Makefile
@ -96,7 +95,6 @@ run-make/issue-40535/Makefile
run-make/issue-47384/Makefile
run-make/issue-47551/Makefile
run-make/issue-51671/Makefile
run-make/issue-64153/Makefile
run-make/issue-68794-textrel-on-minimal-lib/Makefile
run-make/issue-69368/Makefile
run-make/issue-83045/Makefile

View File

@ -1,5 +0,0 @@
include ../tools.mk
all:
touch $(TMPDIR)/libfoo.a
echo | $(RUSTC) - --crate-type=rlib -lstatic=foo 2>&1 | $(CGREP) "failed to add native library"

View File

@ -0,0 +1,17 @@
// If the static library provided is not valid (in this test,
// created as an empty file),
// rustc should print a normal error message and not throw
// an internal compiler error (ICE).
// See https://github.com/rust-lang/rust/pull/28673
use run_make_support::{fs_wrapper, rustc, static_lib_name};
fn main() {
fs_wrapper::create_file(static_lib_name("foo"));
rustc()
.arg("-")
.crate_type("rlib")
.arg("-lstatic=foo")
.run_fail()
.assert_stderr_contains("failed to add native library");
}