Skip to content

Commit

Permalink
rewrite c-unwind-abi-catch-panic to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jul 19, 2024
1 parent 7b19389 commit 2733494
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ run-make/c-dynamic-rlib/Makefile
run-make/c-static-dylib/Makefile
run-make/c-static-rlib/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/cdylib-dylib-linkage/Makefile
run-make/compiler-lookup-paths-2/Makefile
Expand Down
10 changes: 0 additions & 10 deletions tests/run-make/c-unwind-abi-catch-panic/Makefile

This file was deleted.

18 changes: 18 additions & 0 deletions tests/run-make/c-unwind-abi-catch-panic/rmake.rs
Original file line number Diff line number Diff line change
@@ -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");
}

0 comments on commit 2733494

Please sign in to comment.