diff options
| author | Ralf Jung <post@ralfj.de> | 2025-07-18 06:14:25 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-18 06:14:25 +0000 |
| commit | 83395909d074d81086b49cfc400a910d83f40a1e (patch) | |
| tree | c837c657b894da8195d5386499a34c1a6b7c3da5 /tests/codegen | |
| parent | e30baec2175f00a34aa6746a0e0cf811f1baa6d6 (diff) | |
| parent | 3e3166f9b5821b35f19b125147ed8b4cbf71cfc5 (diff) | |
| download | rust-83395909d074d81086b49cfc400a910d83f40a1e.tar.gz rust-83395909d074d81086b49cfc400a910d83f40a1e.zip | |
Merge pull request #4474 from rust-lang/rustup-2025-07-18
Automatic Rustup
Diffstat (limited to 'tests/codegen')
| -rw-r--r-- | tests/codegen/fn-parameters-on-different-lines-debuginfo.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/codegen/fn-parameters-on-different-lines-debuginfo.rs b/tests/codegen/fn-parameters-on-different-lines-debuginfo.rs new file mode 100644 index 00000000000..2097567f322 --- /dev/null +++ b/tests/codegen/fn-parameters-on-different-lines-debuginfo.rs @@ -0,0 +1,22 @@ +//! Make sure that line debuginfo of function parameters are correct even if +//! they are not on the same line. Regression test for +// <https://github.com/rust-lang/rust/issues/45010>. + +//@ compile-flags: -g -Copt-level=0 + +#[rustfmt::skip] // Having parameters on different lines is crucial for this test. +pub fn foo( + x_parameter_not_in_std: i32, + y_parameter_not_in_std: i32, +) -> i32 { + x_parameter_not_in_std + y_parameter_not_in_std +} + +fn main() { + foo(42, 43); // Ensure `wasm32-wasip1` keeps `foo()` (even if `-Copt-level=0`) +} + +// CHECK: !DILocalVariable(name: "x_parameter_not_in_std", arg: 1, +// CHECK-SAME: line: 9 +// CHECK: !DILocalVariable(name: "y_parameter_not_in_std", arg: 2, +// CHECK-SAME: line: 10 |
