Skip to content

Commit 8375ab4

Browse files
committed
Auto merge of #53497 - fukatani:test-debuginfo-function-call, r=tromey
Test with gdb8.2 and add debuginfo printing function call test As far as I can see, `print function()` is not tested. It is important feature for debugging.
2 parents 3499575 + e6bbf7e commit 8375ab4

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

src/test/debuginfo/function-call.rs

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Copyright 2018 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+
// This test does not passed with gdb < 8.0. See #53497.
12+
// min-gdb-version 8.0
13+
14+
// compile-flags:-g
15+
16+
// === GDB TESTS ===================================================================================
17+
18+
// gdb-command:run
19+
20+
// gdb-command:print fun(45, true)
21+
// gdb-check:$1 = true
22+
// gdb-command:print fun(444, false)
23+
// gdb-check:$2 = false
24+
25+
// gdb-command:print r.get_x()
26+
// gdb-check:$3 = 4
27+
28+
#![allow(dead_code, unused_variables)]
29+
30+
struct RegularStruct {
31+
x: i32
32+
}
33+
34+
impl RegularStruct {
35+
fn get_x(&self) -> i32 {
36+
self.x
37+
}
38+
}
39+
40+
fn main() {
41+
let _ = fun(4, true);
42+
let r = RegularStruct{x: 4};
43+
let _ = r.get_x();
44+
45+
zzz(); // #break
46+
}
47+
48+
fn fun(x: isize, y: bool) -> bool {
49+
y
50+
}
51+
52+
fn zzz() { () }

0 commit comments

Comments
 (0)