Add test for unwinding past terminating POF
This commit is contained in:
parent
37f7d322b8
commit
ecd04fd1b5
9
tests/run-make/forced-unwind-terminate-pof/Makefile
Normal file
9
tests/run-make/forced-unwind-terminate-pof/Makefile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# ignore-cross-compile
|
||||||
|
# only-linux
|
||||||
|
include ../tools.mk
|
||||||
|
|
||||||
|
all: foo
|
||||||
|
$(call RUN,foo) | $(CGREP) -v "cannot unwind"
|
||||||
|
|
||||||
|
foo: foo.rs
|
||||||
|
$(RUSTC) $<
|
17
tests/run-make/forced-unwind-terminate-pof/foo.rs
Normal file
17
tests/run-make/forced-unwind-terminate-pof/foo.rs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// Tests that forced unwind through POF Rust frames wouldn't trigger our terminating guards.
|
||||||
|
|
||||||
|
#![feature(c_unwind)]
|
||||||
|
#![no_main]
|
||||||
|
|
||||||
|
extern "C-unwind" {
|
||||||
|
fn pthread_exit(v: *mut core::ffi::c_void) -> !;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsafe extern "C" fn call_pthread_exit() {
|
||||||
|
pthread_exit(core::ptr::null_mut());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
unsafe extern "C-unwind" fn main(_argc: core::ffi::c_int, _argv: *mut *mut core::ffi::c_char) {
|
||||||
|
call_pthread_exit();
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user