From e9edced09694cbc27844acb44fa357ba94823fda Mon Sep 17 00:00:00 2001 From: Oneirical Date: Fri, 17 May 2024 14:41:54 -0400 Subject: [PATCH] rewrite and rename issue-28766 --- src/tools/tidy/src/allowed_run_make_makefiles.txt | 1 - .../{issue-28766 => box-struct-no-segfault}/foo.rs | 0 .../{issue-28766 => box-struct-no-segfault}/main.rs | 0 tests/run-make/box-struct-no-segfault/rmake.rs | 13 +++++++++++++ tests/run-make/issue-28766/Makefile | 5 ----- 5 files changed, 13 insertions(+), 6 deletions(-) rename tests/run-make/{issue-28766 => box-struct-no-segfault}/foo.rs (100%) rename tests/run-make/{issue-28766 => box-struct-no-segfault}/main.rs (100%) create mode 100644 tests/run-make/box-struct-no-segfault/rmake.rs delete mode 100644 tests/run-make/issue-28766/Makefile diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index 1a3d6f8d813..a21a5bf9d99 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -103,7 +103,6 @@ run-make/issue-25581/Makefile run-make/issue-26006/Makefile run-make/issue-26092/Makefile run-make/issue-28595/Makefile -run-make/issue-28766/Makefile run-make/issue-30063/Makefile run-make/issue-33329/Makefile run-make/issue-35164/Makefile diff --git a/tests/run-make/issue-28766/foo.rs b/tests/run-make/box-struct-no-segfault/foo.rs similarity index 100% rename from tests/run-make/issue-28766/foo.rs rename to tests/run-make/box-struct-no-segfault/foo.rs diff --git a/tests/run-make/issue-28766/main.rs b/tests/run-make/box-struct-no-segfault/main.rs similarity index 100% rename from tests/run-make/issue-28766/main.rs rename to tests/run-make/box-struct-no-segfault/main.rs diff --git a/tests/run-make/box-struct-no-segfault/rmake.rs b/tests/run-make/box-struct-no-segfault/rmake.rs new file mode 100644 index 00000000000..5406f765e6c --- /dev/null +++ b/tests/run-make/box-struct-no-segfault/rmake.rs @@ -0,0 +1,13 @@ +// The crate "foo" tied to this test executes a very specific function, +// which involves boxing an instance of the struct Foo. However, +// this once caused a segmentation fault in cargo release builds due to an LLVM +// incorrect assertion. +// This test checks that this bug does not resurface. +// See https://github.com/rust-lang/rust/issues/28766 + +use run_make_support::{rustc, tmp_dir}; + +fn main() { + rustc().opt().input("foo.rs").run(); + rustc().opt().library_search_path(tmp_dir()).input("main.rs").run(); +} diff --git a/tests/run-make/issue-28766/Makefile b/tests/run-make/issue-28766/Makefile deleted file mode 100644 index 96d0bdc2b2a..00000000000 --- a/tests/run-make/issue-28766/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -include ../tools.mk - -all: - $(RUSTC) -O foo.rs - $(RUSTC) -O -L $(TMPDIR) main.rs