rewrite c-unwind-abi-catch-panic to rmake

This commit is contained in:
Oneirical 2024-07-19 14:39:42 -04:00
parent 7b19389d58
commit 27334943ed
3 changed files with 18 additions and 11 deletions

View File

@ -4,7 +4,6 @@ run-make/c-dynamic-rlib/Makefile
run-make/c-static-dylib/Makefile run-make/c-static-dylib/Makefile
run-make/c-static-rlib/Makefile run-make/c-static-rlib/Makefile
run-make/c-unwind-abi-catch-lib-panic/Makefile run-make/c-unwind-abi-catch-lib-panic/Makefile
run-make/c-unwind-abi-catch-panic/Makefile
run-make/cat-and-grep-sanity-check/Makefile run-make/cat-and-grep-sanity-check/Makefile
run-make/cdylib-dylib-linkage/Makefile run-make/cdylib-dylib-linkage/Makefile
run-make/compiler-lookup-paths-2/Makefile run-make/compiler-lookup-paths-2/Makefile

View File

@ -1,10 +0,0 @@
# Exercise unwinding a panic. This catches a panic across an FFI boundary and downcasts it into an integer. The Rust code that panics is in the same directory.
# See https://github.com/rust-lang/rust/commit/baf227ea0c1e07fc54395a51e4b3881d701180cb
# ignore-cross-compile
# needs-unwind
include ../tools.mk
all: $(call NATIVE_STATICLIB,add)
$(RUSTC) main.rs
$(call RUN,main) || exit 1

View File

@ -0,0 +1,18 @@
// A test for calling `C-unwind` functions across foreign function boundaries (FFI).
// This test triggers a panic when calling a foreign function that calls *back* into Rust.
// This catches a panic across an FFI boundary and downcasts it into an integer.
// The Rust code that panics is in the same directory, unlike `c-unwind-abi-catch-lib-panic`.
// See https://github.com/rust-lang/rust/pull/76570
//@ ignore-cross-compile
// Reason: the compiled binary is executed
//@ needs-unwind
// Reason: this test exercises panic unwinding
use run_make_support::{build_native_static_lib, run, rustc};
fn main() {
build_native_static_lib("add");
rustc().input("main.rs").run();
run("main");
}