Use byte offsets when emitting debuginfo columns

This commit is contained in:
Tomasz Miąsko 2020-02-25 00:00:00 +00:00
parent e1a5472508
commit 0c51f2f5a5
6 changed files with 68 additions and 48 deletions

View file

@ -1,16 +1,24 @@
// Verify that emitted debuginfo column nubmers are 1-based. Regression test for issue #65437.
// Verify that debuginfo column nubmers are 1-based byte offsets.
//
// ignore-windows
// compile-flags: -C debuginfo=2
fn main() {
unsafe {
// CHECK: call void @giraffe(), !dbg [[DBG:!.*]]
// CHECK: [[DBG]] = !DILocation(line: 10, column: 9
// Column numbers are 1-based. Regression test for #65437.
// CHECK: call void @giraffe(), !dbg [[A:!.*]]
giraffe();
// Column numbers use byte offests. Regression test for #67360
// CHECK: call void @turtle(), !dbg [[B:!.*]]
/* ż */ turtle();
// CHECK: [[A]] = !DILocation(line: 10, column: 9,
// CHECK: [[B]] = !DILocation(line: 14, column: 10,
}
}
extern {
fn giraffe();
fn turtle();
}