]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/issue12886.rs
auto merge of #17654 : gereeter/rust/no-unnecessary-cell, r=alexcrichton
[rust.git] / src / test / debuginfo / issue12886.rs
1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // ignore-android: FIXME(#10381)
12 // ignore-windows failing on 64-bit bots FIXME #17638
13
14 // compile-flags:-g
15 // gdb-command:break issue12886.rs:30
16 // gdb-command:run
17 // gdb-command:next
18 // gdb-check:[...]31[...]s
19 // gdb-command:continue
20
21 // IF YOU MODIFY THIS FILE, BE CAREFUL TO ADAPT THE LINE NUMBERS IN THE DEBUGGER COMMANDS
22
23 // This test makes sure that gdb does not set unwanted breakpoints in inlined functions. If a
24 // breakpoint existed in unwrap(), then calling `next` would (when stopped at line 27) would stop
25 // in unwrap() instead of stepping over the function invocation. By making sure that `s` is
26 // contained in the output, after calling `next` just once, we can be sure that we did not stop in
27 // unwrap(). (The testing framework doesn't allow for checking that some text is *not* contained in
28 // the output, which is why we have to make the test in this kind of roundabout way)
29 fn bar() -> int {
30     let s = Some(5).unwrap();
31     s
32 }
33
34 fn main() {
35     let _ = bar();
36 }