summaryrefslogtreecommitdiffstats
path: root/tests/debuginfo/issue-12886.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/debuginfo/issue-12886.rs
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/debuginfo/issue-12886.rs')
-rw-r--r--tests/debuginfo/issue-12886.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/debuginfo/issue-12886.rs b/tests/debuginfo/issue-12886.rs
new file mode 100644
index 000000000..389221cbb
--- /dev/null
+++ b/tests/debuginfo/issue-12886.rs
@@ -0,0 +1,30 @@
+// ignore-windows failing on 64-bit bots FIXME #17638
+// ignore-lldb
+// ignore-aarch64
+
+// compile-flags:-g
+
+// gdb-command:run
+// gdb-command:next
+// gdb-check:[...]24[...]let s = Some(5).unwrap(); // #break
+// gdb-command:continue
+
+#![feature(omit_gdb_pretty_printer_section)]
+#![omit_gdb_pretty_printer_section]
+
+// IF YOU MODIFY THIS FILE, BE CAREFUL TO ADAPT THE LINE NUMBERS IN THE DEBUGGER COMMANDS
+
+// This test makes sure that gdb does not set unwanted breakpoints in inlined functions. If a
+// breakpoint existed in unwrap(), then calling `next` would (when stopped at `let s = ...`) stop
+// in unwrap() instead of stepping over the function invocation. By making sure that `s` is
+// contained in the output, after calling `next` just once, we can be sure that we did not stop in
+// unwrap(). (The testing framework doesn't allow for checking that some text is *not* contained in
+// the output, which is why we have to make the test in this kind of roundabout way)
+fn bar() -> isize {
+ let s = Some(5).unwrap(); // #break
+ s
+}
+
+fn main() {
+ let _ = bar();
+}