summaryrefslogtreecommitdiffstats
path: root/tests/debuginfo/issue-12886.rs
blob: 389221cbbf15104c64c7a962fe322c7726722f04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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();
}