rust/tests/run-make/longjmp-across-rust/main.rs
Gary Guo bb531083cc Fix longjmp-across-rust test
Destructor are removed from stack because it's considered UB.
2024-10-10 15:02:47 +01:00

22 lines
276 B
Rust

#[link(name = "foo", kind = "static")]
extern "C" {
fn test_start(f: extern "C" fn());
fn test_end();
}
fn main() {
unsafe {
test_start(test_middle);
}
}
extern "C" fn test_middle() {
foo();
}
fn foo() {
unsafe {
test_end();
}
}