From a795d8998d6715044a4e28ffda90a251a780eae1 Mon Sep 17 00:00:00 2001 From: Oneirical Date: Mon, 8 Jul 2024 13:54:04 -0400 Subject: [PATCH] rewrite and rename issue-25581 --- .../tidy/src/allowed_run_make_makefiles.txt | 1 - tests/run-make/extern-fn-slice-no-ice/rmake.rs | 17 +++++++++++++++++ .../test.c | 0 .../test.rs | 0 tests/run-make/issue-25581/Makefile | 6 ------ 5 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 tests/run-make/extern-fn-slice-no-ice/rmake.rs rename tests/run-make/{issue-25581 => extern-fn-slice-no-ice}/test.c (100%) rename tests/run-make/{issue-25581 => extern-fn-slice-no-ice}/test.rs (100%) delete mode 100644 tests/run-make/issue-25581/Makefile diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index e016d3f1139..5a7fe935e70 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -44,7 +44,6 @@ run-make/issue-107094/Makefile run-make/issue-14698/Makefile run-make/issue-15460/Makefile run-make/issue-22131/Makefile -run-make/issue-25581/Makefile run-make/issue-26006/Makefile run-make/issue-28595/Makefile run-make/issue-33329/Makefile diff --git a/tests/run-make/extern-fn-slice-no-ice/rmake.rs b/tests/run-make/extern-fn-slice-no-ice/rmake.rs new file mode 100644 index 00000000000..1f1bbd33127 --- /dev/null +++ b/tests/run-make/extern-fn-slice-no-ice/rmake.rs @@ -0,0 +1,17 @@ +// Slices were broken when implicated in foreign-function interface (FFI) with +// a C library, with something as simple as measuring the length or returning +// an item at a certain index of a slice would cause an internal compiler error (ICE). +// This was fixed in #25653, and this test checks that slices in Rust-C FFI can be part +// of a program that compiles and executes successfully. +// See https://github.com/rust-lang/rust/issues/25581 + +//@ ignore-cross-compile +// Reason: the compiled binary is executed + +use run_make_support::{build_native_static_lib, run, rustc}; + +fn main() { + build_native_static_lib("test"); + rustc().input("test.rs").run(); + run("test"); +} diff --git a/tests/run-make/issue-25581/test.c b/tests/run-make/extern-fn-slice-no-ice/test.c similarity index 100% rename from tests/run-make/issue-25581/test.c rename to tests/run-make/extern-fn-slice-no-ice/test.c diff --git a/tests/run-make/issue-25581/test.rs b/tests/run-make/extern-fn-slice-no-ice/test.rs similarity index 100% rename from tests/run-make/issue-25581/test.rs rename to tests/run-make/extern-fn-slice-no-ice/test.rs diff --git a/tests/run-make/issue-25581/Makefile b/tests/run-make/issue-25581/Makefile deleted file mode 100644 index 3cbbf383996..00000000000 --- a/tests/run-make/issue-25581/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# ignore-cross-compile -include ../tools.mk - -all: $(call NATIVE_STATICLIB,test) - $(RUSTC) test.rs - $(call RUN,test) || exit 1