Skip to content

Commit 3fda708

Browse files
committed
Add regression test
1 parent eba3228 commit 3fda708

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Regression test for #87481: short backtrace formatting cut off the entire stack trace.
2+
3+
// Codegen-units is specified here so that we can replicate a typical rustc invocation which
4+
// is not normally limited to 1 CGU. This is important so that the `__rust_begin_short_backtrace`
5+
// and `__rust_end_short_backtrace` symbols are not marked internal to the CGU and thus will be
6+
// named in the symbol table.
7+
// compile-flags: -O -Ccodegen-units=8
8+
9+
// run-fail
10+
// check-run-results
11+
// exec-env:RUST_BACKTRACE=1
12+
13+
// Backtraces are pretty broken in general on i686-pc-windows-msvc (#62897).
14+
// only-x86_64-pc-windows-msvc
15+
16+
fn main() {
17+
a();
18+
}
19+
20+
// Make these no_mangle so dbghelp.dll can figure out the symbol names.
21+
22+
#[no_mangle]
23+
#[inline(never)]
24+
fn a() {
25+
b();
26+
}
27+
28+
#[no_mangle]
29+
#[inline(never)]
30+
fn b() {
31+
c();
32+
}
33+
34+
#[no_mangle]
35+
#[inline(never)]
36+
fn c() {
37+
d();
38+
}
39+
40+
#[no_mangle]
41+
#[inline(never)]
42+
fn d() {
43+
panic!("d was called");
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at 'd was called', $DIR/panic-short-backtrace-windows-x86_64.rs:43:5
2+
stack backtrace:
3+
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

0 commit comments

Comments
 (0)