Skip to content

Commit 7d2e06a

Browse files
committed
tests: Test line debuginfo for linebreaked function parameters
1 parent 855e0fe commit 7d2e06a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//! Make sure that line debuginfo of function parameters are correct even if
2+
//! they are not on the same line. Regression test for
3+
// <https://github.com/rust-lang/rust/issues/45010>.
4+
5+
//@ compile-flags: -g -Copt-level=0
6+
7+
#![crate_type = "dylib"]
8+
#[rustfmt::skip] // Having parameters on different lines is crucial for this test.
9+
pub fn foo(
10+
x: i32,
11+
y: i32)
12+
-> i32
13+
{ x + y }
14+
15+
// CHECK: !DILocalVariable(name: "x", arg: 1,
16+
// CHECK-SAME: line: 10
17+
// CHECK: !DILocalVariable(name: "y", arg: 2,
18+
// CHECK-SAME: line: 11

0 commit comments

Comments
 (0)