]> git.lizzy.rs Git - rust.git/blob - src/test/ui/panics/panic-short-backtrace-windows-x86_64.rs
Auto merge of #85344 - cbeuw:remap-across-cwd, r=michaelwoerister
[rust.git] / src / test / ui / panics / panic-short-backtrace-windows-x86_64.rs
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 // We need to normalize out frame 5 because without debug info, dbghelp.dll doesn't know where CGU
14 // internal functions like `main` start or end and so it will return whatever symbol happens
15 // to be located near the address.
16 // normalize-stderr-test: "5: .*" -> "5: some Rust fn"
17
18 // Backtraces are pretty broken in general on i686-pc-windows-msvc (#62897).
19 // only-x86_64-pc-windows-msvc
20
21 fn main() {
22     a();
23 }
24
25 // Make these no_mangle so dbghelp.dll can figure out the symbol names.
26
27 #[no_mangle]
28 #[inline(never)]
29 fn a() {
30     b();
31 }
32
33 #[no_mangle]
34 #[inline(never)]
35 fn b() {
36     c();
37 }
38
39 #[no_mangle]
40 #[inline(never)]
41 fn c() {
42     d();
43 }
44
45 #[no_mangle]
46 #[inline(never)]
47 fn d() {
48     panic!("d was called");
49 }