Auto merge of #127624 - Oneirical:a-test-of-lime, r=jieyouxu

Migrate and rename `issue-47551`, `issue-35164` and `issue-69368` `run-make` tests to rmake

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

try-job: dist-x86_64-msvc
This commit is contained in:
bors 2024-08-02 00:03:42 +00:00
commit 425ae69588
14 changed files with 59 additions and 37 deletions

View File

@ -247,7 +247,7 @@ impl CompletedProcess {
/// Checks that `stderr` does not contain `unexpected`.
#[track_caller]
pub fn assert_stderr_not_contains<S: AsRef<str>>(&self, unexpected: S) -> &Self {
assert_not_contains(&self.stdout_utf8(), unexpected);
assert_not_contains(&self.stderr_utf8(), unexpected);
self
}

View File

@ -14,10 +14,7 @@ run-make/fmt-write-bloat/Makefile
run-make/foreign-double-unwind/Makefile
run-make/foreign-exceptions/Makefile
run-make/incr-add-rust-src-component/Makefile
run-make/issue-35164/Makefile
run-make/issue-36710/Makefile
run-make/issue-47551/Makefile
run-make/issue-69368/Makefile
run-make/issue-84395-lto-embed-bitcode/Makefile
run-make/issue-88756-default-output/Makefile
run-make/jobserver-error/Makefile

View File

@ -0,0 +1,20 @@
// Test that previously triggered a linker failure with root cause
// similar to one found in the issue #69368.
//
// The crate that provides oom lang item is missing some other lang
// items. Necessary to prevent the use of start-group / end-group.
//
// The weak lang items are defined in a separate compilation units,
// so that linker could omit them if not used.
//
// The crates that need those weak lang items are dependencies of
// crates that provide them.
// See https://github.com/rust-lang/rust/issues/69371
use run_make_support::rustc;
fn main() {
rustc().input("a.rs").run();
rustc().input("b.rs").run();
rustc().input("c.rs").run();
}

View File

@ -1,4 +0,0 @@
include ../tools.mk
all:
$(RUSTC) main.rs --error-format json 2>&1 | $(CGREP) -e '"byte_start":23\b' '"byte_end":29\b'

View File

@ -1,10 +0,0 @@
# only-linux
# ignore-32bit
include ../tools.mk
all:
# --target $(TARGET) ensures the right gcc flags are used for cross compilation
$(RUSTC) --target $(TARGET) eh_frame-terminator.rs
$(call RUN,eh_frame-terminator) | $(CGREP) '1122334455667788'
objdump --dwarf=frames $(TMPDIR)/eh_frame-terminator | $(CGREP) 'ZERO terminator'

View File

@ -1,19 +0,0 @@
# ignore-cross-compile
include ../tools.mk
# Test that previously triggered a linker failure with root cause
# similar to one found in the issue #69368.
#
# The crate that provides oom lang item is missing some other lang
# items. Necessary to prevent the use of start-group / end-group.
#
# The weak lang items are defined in a separate compilation units,
# so that linker could omit them if not used.
#
# The crates that need those weak lang items are dependencies of
# crates that provide them.
all:
$(RUSTC) a.rs
$(RUSTC) b.rs
$(RUSTC) c.rs

View File

@ -0,0 +1,15 @@
// The byte positions in json format error logging used to have a small, difficult
// to predict offset. This was changed to be the top of the file every time in #42973,
// and this test checks that the measurements appearing in the standard error are correct.
// See https://github.com/rust-lang/rust/issues/35164
use run_make_support::rustc;
fn main() {
rustc()
.input("main.rs")
.error_format("json")
.run()
.assert_stderr_contains(r#""byte_start":23"#)
.assert_stderr_contains(r#""byte_end":29"#);
}

View File

@ -0,0 +1,23 @@
// The gcc driver is supposed to add a terminator to link files, and the rustc
// driver previously failed to do this, resulting in a segmentation fault
// with an older version of LLVM. This test checks that the terminator is present
// after the fix in #85395.
// See https://github.com/rust-lang/rust/issues/47551
//@ only-linux
// Reason: the ZERO terminator is unique to the Linux architecture.
//@ ignore-32bit
// Reason: the usage of a large array in the test causes an out-of-memory
// error on 32 bit systems.
use run_make_support::{bin_name, llvm_objdump, run, rustc};
fn main() {
rustc().input("eh_frame-terminator.rs").run();
run("eh_frame-terminator").assert_stdout_contains("1122334455667788");
llvm_objdump()
.arg("--dwarf=frames")
.input(bin_name("eh_frame-terminator"))
.run()
.assert_stdout_contains("ZERO terminator");
}