]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/function-arguments.rs
Auto merge of #54939 - pnkfelix:issue-54478-dont-prefer-dynamic-in-doc-tests, r=Quiet...
[rust.git] / src / test / debuginfo / function-arguments.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 // min-lldb-version: 310
12
13 // compile-flags:-g
14
15 // === GDB TESTS ===================================================================================
16
17 // gdb-command:run
18
19 // gdb-command:print x
20 // gdb-check:$1 = 111102
21 // gdb-command:print y
22 // gdb-check:$2 = true
23 // gdb-command:continue
24
25 // gdb-command:print a
26 // gdb-check:$3 = 2000
27 // gdb-command:print b
28 // gdb-check:$4 = 3000
29 // gdb-command:continue
30
31 // === LLDB TESTS ==================================================================================
32
33 // lldb-command:run
34
35 // lldb-command:print x
36 // lldbg-check:[...]$0 = 111102
37 // lldbr-check:(isize) x = 111102
38 // lldb-command:print y
39 // lldbg-check:[...]$1 = true
40 // lldbr-check:(bool) y = true
41 // lldb-command:continue
42
43 // lldb-command:print a
44 // lldbg-check:[...]$2 = 2000
45 // lldbr-check:(i32) a = 2000
46 // lldb-command:print b
47 // lldbg-check:[...]$3 = 3000
48 // lldbr-check:(i64) b = 3000
49 // lldb-command:continue
50
51
52 #![feature(omit_gdb_pretty_printer_section)]
53 #![omit_gdb_pretty_printer_section]
54
55 fn main() {
56
57     fun(111102, true);
58     nested(2000, 3000);
59
60     fn nested(a: i32, b: i64) -> (i32, i64) {
61         zzz(); // #break
62         (a, b)
63     }
64 }
65
66 fn fun(x: isize, y: bool) -> (isize, bool) {
67     zzz(); // #break
68
69     (x, y)
70 }
71
72 fn zzz() { () }