2023-03-21 05:48:03 -05: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-06 19:29:42 -05:00
|
|
|
#[inline(never)]
|
2023-03-21 05:48:03 -05: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-06 19:29:42 -05:00
|
|
|
// CHECK-SAME: line: 15
|
2024-08-12 21:20:00 -05:00
|
|
|
// CHECK-NOT: !DILexicalBlock(
|
2023-03-21 05:48:03 -05:00
|
|
|
// CHECK: !DILocalVariable(name: "bbbb", arg: 2
|
2023-10-06 19:29:42 -05:00
|
|
|
// CHECK-SAME: line: 15
|
2023-03-21 05:48:03 -05:00
|
|
|
aaaa + bbbb
|
|
|
|
}
|