2023-03-21 10:48:03 +00:00
|
|
|
// This test checks that debug information includes function argument indexes even if the function
|
|
|
|
// gets inlined by MIR inlining. Without function argument indexes, `info args` in gdb won't show
|
|
|
|
// arguments and their values for the current function.
|
|
|
|
|
|
|
|
//@ compile-flags: -Zinline-mir=yes -Cdebuginfo=2 --edition=2021
|
|
|
|
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
2023-10-07 00:29:42 +00:00
|
|
|
#[inline(never)]
|
2023-03-21 10:48:03 +00:00
|
|
|
pub fn outer_function(x: usize, y: usize) -> usize {
|
|
|
|
inner_function(x, y) + 1
|
|
|
|
}
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
fn inner_function(aaaa: usize, bbbb: usize) -> usize {
|
|
|
|
// CHECK: !DILocalVariable(name: "aaaa", arg: 1
|
2023-10-07 00:29:42 +00:00
|
|
|
// CHECK-SAME: line: 15
|
2023-03-21 10:48:03 +00:00
|
|
|
// CHECK: !DILocalVariable(name: "bbbb", arg: 2
|
2023-10-07 00:29:42 +00:00
|
|
|
// CHECK-SAME: line: 15
|
2023-03-21 10:48:03 +00:00
|
|
|
aaaa + bbbb
|
|
|
|
}
|