2022-01-25 22:14:26 -05:00
|
|
|
// Test for std::panic::set_backtrace_style.
|
|
|
|
|
|
|
|
|
|
//@ compile-flags: -O
|
2022-06-15 16:36:19 +03:00
|
|
|
//@ compile-flags:-Cstrip=none
|
2022-01-25 22:14:26 -05:00
|
|
|
//@ run-fail
|
|
|
|
|
//@ check-run-results
|
|
|
|
|
//@ exec-env:RUST_BACKTRACE=0
|
|
|
|
|
|
2025-07-26 13:23:20 +02:00
|
|
|
// FIXME(#61117): Respect debuginfo-level-tests, do not force debuginfo-level=0
|
|
|
|
|
//@ compile-flags: -Cdebuginfo=0
|
|
|
|
|
|
2024-11-23 13:19:17 -05:00
|
|
|
// This is needed to avoid test output differences across std being built with v0 symbols vs legacy
|
|
|
|
|
// symbols.
|
2024-12-25 22:12:17 +11:00
|
|
|
//@ normalize-stderr: "begin_panic::<&str>" -> "begin_panic"
|
2024-12-26 15:47:26 +11:00
|
|
|
// This variant occurs on macOS with `rust.debuginfo-level = "line-tables-only"` (#133997)
|
2024-12-25 22:12:17 +11:00
|
|
|
//@ normalize-stderr: " begin_panic<&str>" -> " std::panicking::begin_panic"
|
2024-11-23 13:19:17 -05:00
|
|
|
// And this is for differences between std with and without debuginfo.
|
2024-12-25 22:12:17 +11:00
|
|
|
//@ normalize-stderr: "\n +at [^\n]+" -> ""
|
2024-11-23 13:19:17 -05:00
|
|
|
|
2022-01-25 22:14:26 -05:00
|
|
|
//@ ignore-msvc see #62897 and `backtrace-debuginfo.rs` test
|
|
|
|
|
//@ ignore-android FIXME #17520
|
|
|
|
|
//@ ignore-openbsd no support for libbacktrace without filename
|
2024-03-06 12:44:54 -08:00
|
|
|
//@ ignore-wasm no backtrace support
|
2022-09-19 21:00:10 +00:00
|
|
|
//@ ignore-fuchsia Backtrace not symbolized
|
2025-01-23 16:36:54 +08:00
|
|
|
//@ needs-subprocess
|
2022-01-25 22:14:26 -05:00
|
|
|
|
|
|
|
|
#![feature(panic_backtrace_config)]
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
std::panic::set_backtrace_style(std::panic::BacktraceStyle::Short);
|
|
|
|
|
panic!()
|
|
|
|
|
}
|