rewrite longjmp-across-rust to rmake

This commit is contained in:
Oneirical 2024-07-08 14:15:01 -04:00
parent d6a3f65db0
commit 98454ece33
3 changed files with 18 additions and 7 deletions

View File

@ -65,7 +65,6 @@ run-make/link-path-order/Makefile
run-make/linkage-attr-on-static/Makefile
run-make/long-linker-command-lines-cmd-exe/Makefile
run-make/long-linker-command-lines/Makefile
run-make/longjmp-across-rust/Makefile
run-make/lto-linkage-used-attr/Makefile
run-make/lto-no-link-whole-rlib/Makefile
run-make/lto-smoke-c/Makefile

View File

@ -1,6 +0,0 @@
# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,foo)
$(RUSTC) main.rs
$(call RUN,main)

View File

@ -0,0 +1,18 @@
// longjmp, an error handling function used in C, is useful
// for jumping out of nested call chains... but it used to accidentally
// trigger Rust's cleanup system in a way that caused an unexpected abortion
// of the program. After this was fixed in #48572, this test compiles and executes
// a program that jumps between Rust and its C library, with longjmp included. For
// the test to succeed, no unexpected abortion should occur.
// See https://github.com/rust-lang/rust/pull/48572
//@ 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("foo");
rustc().input("main.rs").run();
run("main");
}