From a2e7e79a137a853b250ed106c16e61106b900d3b Mon Sep 17 00:00:00 2001 From: Oneirical Date: Sat, 11 May 2024 16:41:07 -0400 Subject: [PATCH 1/4] Port c-link-to-rust-va-list-fn to Rust --- .../tidy/src/allowed_run_make_makefiles.txt | 1 - .../c-link-to-rust-va-list-fn/Makefile | 7 ------- .../c-link-to-rust-va-list-fn/rmake.rs | 21 +++++++++++++++++++ 3 files changed, 21 insertions(+), 8 deletions(-) delete mode 100644 tests/run-make/c-link-to-rust-va-list-fn/Makefile create mode 100644 tests/run-make/c-link-to-rust-va-list-fn/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 e87950b36d9df..029bb7806dbd5 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -12,7 +12,6 @@ run-make/c-dynamic-dylib/Makefile run-make/c-dynamic-rlib/Makefile run-make/c-link-to-rust-dylib/Makefile run-make/c-link-to-rust-staticlib/Makefile -run-make/c-link-to-rust-va-list-fn/Makefile run-make/c-static-dylib/Makefile run-make/c-static-rlib/Makefile run-make/c-unwind-abi-catch-lib-panic/Makefile diff --git a/tests/run-make/c-link-to-rust-va-list-fn/Makefile b/tests/run-make/c-link-to-rust-va-list-fn/Makefile deleted file mode 100644 index 596c0fce3ceae..0000000000000 --- a/tests/run-make/c-link-to-rust-va-list-fn/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# ignore-cross-compile -include ../tools.mk - -all: - $(RUSTC) checkrust.rs - $(CC) test.c $(call STATICLIB,checkrust) $(call OUT_EXE,test) $(EXTRACFLAGS) - $(call RUN,test) diff --git a/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs b/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs new file mode 100644 index 0000000000000..d8d0e064c6080 --- /dev/null +++ b/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs @@ -0,0 +1,21 @@ +// test.c and its static library checkrust.rs make use of variadic functions (VaList). +// This test checks that the use of this feature does not +// prevent the creation of a functional binary. +// See https://github.com/rust-lang/rust/pull/49878 + +//@ ignore-cross-compile + +use run_make_support::{cc, extra_c_flags, run, rustc, static_lib}; + +fn main() { + rustc() + .input("checkrust.rs") + .run(); + cc() + .input("test.c") + .input(static_lib("checkrust")) + .out_exe("test") + .args(&extra_c_flags()) + .run(); + run("test"); +} From e37d2989c1d1f1600f3769ce6f46e77493169b8d Mon Sep 17 00:00:00 2001 From: Julien <96022417+Oneirical@users.noreply.github.com> Date: Sat, 11 May 2024 16:52:28 -0400 Subject: [PATCH 2/4] remove trailing whitespace --- tests/run-make/c-link-to-rust-va-list-fn/rmake.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs b/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs index d8d0e064c6080..36c31f973c6c7 100644 --- a/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs +++ b/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs @@ -1,5 +1,5 @@ // test.c and its static library checkrust.rs make use of variadic functions (VaList). -// This test checks that the use of this feature does not +// This test checks that the use of this feature does not // prevent the creation of a functional binary. // See https://github.com/rust-lang/rust/pull/49878 From 10c358f11189de4f639106253c8178dbbfa3f68e Mon Sep 17 00:00:00 2001 From: Julien <96022417+Oneirical@users.noreply.github.com> Date: Sat, 11 May 2024 16:59:29 -0400 Subject: [PATCH 3/4] Make tidy happy --- tests/run-make/c-link-to-rust-va-list-fn/rmake.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs b/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs index 36c31f973c6c7..489a637c44533 100644 --- a/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs +++ b/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs @@ -8,11 +8,9 @@ use run_make_support::{cc, extra_c_flags, run, rustc, static_lib}; fn main() { - rustc() - .input("checkrust.rs") + rustc().input("checkrust.rs") .run(); - cc() - .input("test.c") + cc().input("test.c") .input(static_lib("checkrust")) .out_exe("test") .args(&extra_c_flags()) From 812f89728a3a1fbf3979e552fcb888fe6a500c19 Mon Sep 17 00:00:00 2001 From: Oneirical Date: Mon, 13 May 2024 22:15:11 -0400 Subject: [PATCH 4/4] fix fmt --- tests/run-make/c-link-to-rust-va-list-fn/rmake.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs b/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs index 489a637c44533..7a450efff942a 100644 --- a/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs +++ b/tests/run-make/c-link-to-rust-va-list-fn/rmake.rs @@ -8,8 +8,7 @@ use run_make_support::{cc, extra_c_flags, run, rustc, static_lib}; fn main() { - rustc().input("checkrust.rs") - .run(); + rustc().input("checkrust.rs").run(); cc().input("test.c") .input(static_lib("checkrust")) .out_exe("test")