]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/issue-12886.rs
Merge commit '7d53619064ab7045c383644cb445052d2a3d46db' into sync_cg_clif-2023-02-09
[rust.git] / tests / debuginfo / issue-12886.rs
1 // ignore-windows failing on 64-bit bots FIXME #17638
2 // ignore-lldb
3 // ignore-aarch64
4
5 // compile-flags:-g
6
7 // gdb-command:run
8 // gdb-command:next
9 // gdb-check:[...]24[...]let s = Some(5).unwrap(); // #break
10 // gdb-command:continue
11
12 #![feature(omit_gdb_pretty_printer_section)]
13 #![omit_gdb_pretty_printer_section]
14
15 // IF YOU MODIFY THIS FILE, BE CAREFUL TO ADAPT THE LINE NUMBERS IN THE DEBUGGER COMMANDS
16
17 // This test makes sure that gdb does not set unwanted breakpoints in inlined functions. If a
18 // breakpoint existed in unwrap(), then calling `next` would (when stopped at `let s = ...`) stop
19 // in unwrap() instead of stepping over the function invocation. By making sure that `s` is
20 // contained in the output, after calling `next` just once, we can be sure that we did not stop in
21 // unwrap(). (The testing framework doesn't allow for checking that some text is *not* contained in
22 // the output, which is why we have to make the test in this kind of roundabout way)
23 fn bar() -> isize {
24     let s = Some(5).unwrap(); // #break
25     s
26 }
27
28 fn main() {
29     let _ = bar();
30 }