diff options
| author | bors <bors@rust-lang.org> | 2024-05-19 08:28:03 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-05-19 08:28:03 +0000 |
| commit | 9f4b6517208d77556a919789ed285e0c6f67bbb5 (patch) | |
| tree | ed59ba0a778df31624015f2719f19f215d36e429 /tests/codegen/inline-function-args-debug-info.rs | |
| parent | 143661a7f0df8b456f9caffbb1fabafcd4407db0 (diff) | |
| parent | c944b01b81abe1f28f3f8dd9bf883bd66facc7de (diff) | |
| download | rust-9f4b6517208d77556a919789ed285e0c6f67bbb5.tar.gz rust-9f4b6517208d77556a919789ed285e0c6f67bbb5.zip | |
Auto merge of #17259 - lnicola:sync-from-rust, r=lnicola
internal: Sync from downstream
Diffstat (limited to 'tests/codegen/inline-function-args-debug-info.rs')
| -rw-r--r-- | tests/codegen/inline-function-args-debug-info.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/codegen/inline-function-args-debug-info.rs b/tests/codegen/inline-function-args-debug-info.rs new file mode 100644 index 00000000000..7263374b22e --- /dev/null +++ b/tests/codegen/inline-function-args-debug-info.rs @@ -0,0 +1,21 @@ +// 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"] + +#[inline(never)] +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 + // CHECK-SAME: line: 15 + // CHECK: !DILocalVariable(name: "bbbb", arg: 2 + // CHECK-SAME: line: 15 + aaaa + bbbb +} |
