]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/function-call.rs
Merge commit '7d53619064ab7045c383644cb445052d2a3d46db' into sync_cg_clif-2023-02-09
[rust.git] / tests / debuginfo / function-call.rs
1 // This test does not passed with gdb < 8.0. See #53497.
2 // min-gdb-version: 10.1
3
4 // compile-flags:-g
5
6 // === GDB TESTS ===================================================================================
7
8 // gdb-command:run
9
10 // gdb-command:print fun(45, true)
11 // gdb-check:$1 = true
12 // gdb-command:print fun(444, false)
13 // gdb-check:$2 = false
14
15 // gdb-command:print r.get_x()
16 // gdb-check:$3 = 4
17
18 #![allow(dead_code, unused_variables)]
19
20 struct RegularStruct {
21     x: i32
22 }
23
24 impl RegularStruct {
25     fn get_x(&self) -> i32 {
26         self.x
27     }
28 }
29
30 fn main() {
31     let _ = fun(4, true);
32     let r = RegularStruct{x: 4};
33     let _ = r.get_x();
34
35     zzz(); // #break
36 }
37
38 fn fun(x: isize, y: bool) -> bool {
39     y
40 }
41
42 fn zzz() { () }