From 83234a0f21a46536cedfd46dc8d0f2d447565541 Mon Sep 17 00:00:00 2001 From: Oneirical Date: Thu, 11 Jul 2024 15:36:06 -0400 Subject: [PATCH] rewrite and rename issue-47551 to rmake --- .../tidy/src/allowed_run_make_makefiles.txt | 1 - tests/run-make/issue-47551/Makefile | 10 ---------- .../eh_frame-terminator.rs | 0 .../link-eh-frame-terminator/rmake.rs | 20 +++++++++++++++++++ 4 files changed, 20 insertions(+), 11 deletions(-) delete mode 100644 tests/run-make/issue-47551/Makefile rename tests/run-make/{issue-47551 => link-eh-frame-terminator}/eh_frame-terminator.rs (100%) create mode 100644 tests/run-make/link-eh-frame-terminator/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 fa340a02213..2a1b7500e5b 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -19,7 +19,6 @@ run-make/foreign-rust-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 diff --git a/tests/run-make/issue-47551/Makefile b/tests/run-make/issue-47551/Makefile deleted file mode 100644 index 3fe0a6e74e0..00000000000 --- a/tests/run-make/issue-47551/Makefile +++ /dev/null @@ -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' diff --git a/tests/run-make/issue-47551/eh_frame-terminator.rs b/tests/run-make/link-eh-frame-terminator/eh_frame-terminator.rs similarity index 100% rename from tests/run-make/issue-47551/eh_frame-terminator.rs rename to tests/run-make/link-eh-frame-terminator/eh_frame-terminator.rs diff --git a/tests/run-make/link-eh-frame-terminator/rmake.rs b/tests/run-make/link-eh-frame-terminator/rmake.rs new file mode 100644 index 00000000000..750d068ac98 --- /dev/null +++ b/tests/run-make/link-eh-frame-terminator/rmake.rs @@ -0,0 +1,20 @@ +// 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 + +//FIXME(Oneirical): See if it works on anything other than only linux and 64 bit +// maybe riscv64gc-unknown-linux-gnu + +use run_make_support::{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("eh_frame-terminator") + .run() + .assert_stdout_contains("ZERO terminator"); +}