Auto merge of #3906 - RalfJung:abort_unwind, r=RalfJung
add test for new abort_unwind function Seems like a good thing to have an explicit test for. Cc https://github.com/rust-lang/rust/issues/130338
This commit is contained in:
11
src/tools/miri/tests/fail/panic/abort_unwind.rs
Normal file
11
src/tools/miri/tests/fail/panic/abort_unwind.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
//@error-in-other-file: the program aborted execution
|
||||
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
|
||||
//@normalize-stderr-test: "\| +\^+" -> "| ^"
|
||||
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
|
||||
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
|
||||
|
||||
#![feature(abort_unwind)]
|
||||
|
||||
fn main() {
|
||||
std::panic::abort_unwind(|| panic!("PANIC!!!"));
|
||||
}
|
||||
33
src/tools/miri/tests/fail/panic/abort_unwind.stderr
Normal file
33
src/tools/miri/tests/fail/panic/abort_unwind.stderr
Normal file
@@ -0,0 +1,33 @@
|
||||
thread 'main' panicked at tests/fail/panic/abort_unwind.rs:LL:CC:
|
||||
PANIC!!!
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
|
||||
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
|
||||
panic in a function that cannot unwind
|
||||
stack backtrace:
|
||||
thread caused non-unwinding panic. aborting.
|
||||
error: abnormal termination: the program aborted execution
|
||||
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
|
|
||||
LL | ABORT();
|
||||
| ^ the program aborted execution
|
||||
|
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
|
||||
= note: inside `std::panicking::rust_panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
|
||||
= note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC
|
||||
= note: inside `core::panicking::panic_cannot_unwind` at RUSTLIB/core/src/panicking.rs:LL:CC
|
||||
= note: inside `std::panic::abort_unwind::<{closure@tests/fail/panic/abort_unwind.rs:LL:CC}, ()>` at RUSTLIB/core/src/panic.rs:LL:CC
|
||||
note: inside `main`
|
||||
--> tests/fail/panic/abort_unwind.rs:LL:CC
|
||||
|
|
||||
LL | std::panic::abort_unwind(|| panic!("PANIC!!!"));
|
||||
| ^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
Reference in New Issue
Block a user