summaryrefslogtreecommitdiffstats
path: root/src/test/ui/panics/panic-short-backtrace-windows-x86_64.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/panics/panic-short-backtrace-windows-x86_64.rs
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/panics/panic-short-backtrace-windows-x86_64.rs')
-rw-r--r--src/test/ui/panics/panic-short-backtrace-windows-x86_64.rs53
1 files changed, 53 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 000000000..39ffe86dd
--- /dev/null
+++ b/src/test/ui/panics/panic-short-backtrace-windows-x86_64.rs
@@ -0,0 +1,53 @@
+// This test has been spuriously failing a lot recently (#92000).
+// Ignore it until the underlying issue is fixed.
+// ignore-test
+
+// 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
+
+// We need to normalize out frame 5 because without debug info, dbghelp.dll doesn't know where CGU
+// internal functions like `main` start or end and so it will return whatever symbol happens
+// to be located near the address.
+// normalize-stderr-test: "5: .*" -> "5: some Rust fn"
+
+// 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");
+}