diff options
| author | Wesley Wiser <wesleywiser@microsoft.com> | 2021-07-28 11:40:53 -0400 |
|---|---|---|
| committer | Wesley Wiser <wesleywiser@microsoft.com> | 2021-07-29 13:51:27 -0400 |
| commit | 3fda7086cc810ce3003b91f74eb1c17e9f016319 (patch) | |
| tree | 4bcb198afbda358830e2c7fc01215737a2fff7b2 | |
| parent | eba3228b2a9875d268ff3990903d04e19f6cdb0c (diff) | |
| download | rust-3fda7086cc810ce3003b91f74eb1c17e9f016319.tar.gz rust-3fda7086cc810ce3003b91f74eb1c17e9f016319.zip | |
Add regression test
| -rw-r--r-- | src/test/ui/panics/panic-short-backtrace-windows-x86_64.rs | 44 | ||||
| -rw-r--r-- | src/test/ui/panics/panic-short-backtrace-windows-x86_64.run.stderr | 3 |
2 files changed, 47 insertions, 0 deletions
diff --git a/src/test/ui/panics/panic-short-backtrace-windows-x86_64.rs b/src/test/ui/panics/panic-short-backtrace-windows-x86_64.rs new file mode 100644 index 00000000000..eae3f861519 --- /dev/null +++ b/src/test/ui/panics/panic-short-backtrace-windows-x86_64.rs @@ -0,0 +1,44 @@ +// Regression test for #87481: short backtrace formatting cut off the entire stack trace. + +// Codegen-units is specified here so that we can replicate a typical rustc invocation which +// is not normally limited to 1 CGU. This is important so that the `__rust_begin_short_backtrace` +// and `__rust_end_short_backtrace` symbols are not marked internal to the CGU and thus will be +// named in the symbol table. +// compile-flags: -O -Ccodegen-units=8 + +// run-fail +// check-run-results +// exec-env:RUST_BACKTRACE=1 + +// Backtraces are pretty broken in general on i686-pc-windows-msvc (#62897). +// only-x86_64-pc-windows-msvc + +fn main() { + a(); +} + +// Make these no_mangle so dbghelp.dll can figure out the symbol names. + +#[no_mangle] +#[inline(never)] +fn a() { + b(); +} + +#[no_mangle] +#[inline(never)] +fn b() { + c(); +} + +#[no_mangle] +#[inline(never)] +fn c() { + d(); +} + +#[no_mangle] +#[inline(never)] +fn d() { + panic!("d was called"); +} diff --git a/src/test/ui/panics/panic-short-backtrace-windows-x86_64.run.stderr b/src/test/ui/panics/panic-short-backtrace-windows-x86_64.run.stderr new file mode 100644 index 00000000000..f855346532f --- /dev/null +++ b/src/test/ui/panics/panic-short-backtrace-windows-x86_64.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at 'd was called', $DIR/panic-short-backtrace-windows-x86_64.rs:43:5 +stack backtrace: +note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. |
