From 760b505c9aef6f6a144a9bb0e4836d27a502d77f Mon Sep 17 00:00:00 2001 From: Oneirical Date: Fri, 17 May 2024 11:06:21 -0400 Subject: [PATCH] Rewrite static-unwinding as rmake.rs --- src/tools/tidy/src/allowed_run_make_makefiles.txt | 1 - tests/run-make/static-unwinding/Makefile | 8 -------- tests/run-make/static-unwinding/rmake.rs | 15 +++++++++++++++ 3 files changed, 15 insertions(+), 9 deletions(-) delete mode 100644 tests/run-make/static-unwinding/Makefile create mode 100644 tests/run-make/static-unwinding/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 1a3d6f8d813..0ccb39d64e7 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -264,7 +264,6 @@ run-make/stable-symbol-names/Makefile run-make/static-dylib-by-default/Makefile run-make/static-extern-type/Makefile run-make/static-pie/Makefile -run-make/static-unwinding/Makefile run-make/staticlib-blank-lib/Makefile run-make/staticlib-dylib-linkage/Makefile run-make/std-core-cycle/Makefile diff --git a/tests/run-make/static-unwinding/Makefile b/tests/run-make/static-unwinding/Makefile deleted file mode 100644 index 4b093f93608..00000000000 --- a/tests/run-make/static-unwinding/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# ignore-cross-compile -# needs-unwind -include ../tools.mk - -all: - $(RUSTC) lib.rs - $(RUSTC) main.rs - $(call RUN,main) diff --git a/tests/run-make/static-unwinding/rmake.rs b/tests/run-make/static-unwinding/rmake.rs new file mode 100644 index 00000000000..ee3d9a342f9 --- /dev/null +++ b/tests/run-make/static-unwinding/rmake.rs @@ -0,0 +1,15 @@ +// During unwinding, an implementation of Drop is possible to clean up resources. +// This test implements drop in both a main function and its static library. +// If the test succeeds, a Rust program being a static library does not affect Drop implementations. +// See https://github.com/rust-lang/rust/issues/10434 + +//@ ignore-cross-compile +//@ needs-unwind + +use run_make_support::{run, rustc}; + +fn main() { + rustc().input("lib.rs").run(); + rustc().input("main.rs").run(); + run("main"); +}