From 5e55f07cc0d843dff89a1b29fb15b66e99391627 Mon Sep 17 00:00:00 2001 From: Oneirical Date: Fri, 12 Jul 2024 14:57:05 -0400 Subject: [PATCH] rewrite and rename issue-28595 to rmake --- .../tidy/src/allowed_run_make_makefiles.txt | 1 - tests/run-make/issue-28595/Makefile | 7 ------- .../{issue-28595 => native-lib-load-order}/a.c | 0 .../{issue-28595 => native-lib-load-order}/a.rs | 0 .../{issue-28595 => native-lib-load-order}/b.c | 0 .../{issue-28595 => native-lib-load-order}/b.rs | 0 tests/run-make/native-lib-load-order/rmake.rs | 16 ++++++++++++++++ 7 files changed, 16 insertions(+), 8 deletions(-) delete mode 100644 tests/run-make/issue-28595/Makefile rename tests/run-make/{issue-28595 => native-lib-load-order}/a.c (100%) rename tests/run-make/{issue-28595 => native-lib-load-order}/a.rs (100%) rename tests/run-make/{issue-28595 => native-lib-load-order}/b.c (100%) rename tests/run-make/{issue-28595 => native-lib-load-order}/b.rs (100%) create mode 100644 tests/run-make/native-lib-load-order/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 07fd5d3e9b8..d935bb10d77 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -37,7 +37,6 @@ run-make/interdependent-c-libraries/Makefile run-make/issue-107094/Makefile run-make/issue-14698/Makefile run-make/issue-15460/Makefile -run-make/issue-28595/Makefile run-make/issue-33329/Makefile run-make/issue-35164/Makefile run-make/issue-36710/Makefile diff --git a/tests/run-make/issue-28595/Makefile b/tests/run-make/issue-28595/Makefile deleted file mode 100644 index 258f9788aaf..00000000000 --- a/tests/run-make/issue-28595/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# ignore-cross-compile -include ../tools.mk - -all: $(call NATIVE_STATICLIB,a) $(call NATIVE_STATICLIB,b) - $(RUSTC) a.rs - $(RUSTC) b.rs - $(call RUN,b) diff --git a/tests/run-make/issue-28595/a.c b/tests/run-make/native-lib-load-order/a.c similarity index 100% rename from tests/run-make/issue-28595/a.c rename to tests/run-make/native-lib-load-order/a.c diff --git a/tests/run-make/issue-28595/a.rs b/tests/run-make/native-lib-load-order/a.rs similarity index 100% rename from tests/run-make/issue-28595/a.rs rename to tests/run-make/native-lib-load-order/a.rs diff --git a/tests/run-make/issue-28595/b.c b/tests/run-make/native-lib-load-order/b.c similarity index 100% rename from tests/run-make/issue-28595/b.c rename to tests/run-make/native-lib-load-order/b.c diff --git a/tests/run-make/issue-28595/b.rs b/tests/run-make/native-lib-load-order/b.rs similarity index 100% rename from tests/run-make/issue-28595/b.rs rename to tests/run-make/native-lib-load-order/b.rs diff --git a/tests/run-make/native-lib-load-order/rmake.rs b/tests/run-make/native-lib-load-order/rmake.rs new file mode 100644 index 00000000000..ffe20a64168 --- /dev/null +++ b/tests/run-make/native-lib-load-order/rmake.rs @@ -0,0 +1,16 @@ +// An old compiler bug from 2015 caused native libraries to be loaded in the +// wrong order, causing `b` to be loaded before `a` in this test. If the compilation +// is successful, the libraries were loaded in the correct order. + +//@ 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("a"); + build_native_static_lib("b"); + rustc().input("a.rs").run(); + rustc().input("b.rs").run(); + run("b"); +}