[llvm] [MC] Add .loc_label instruction (PR #99710)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 22 08:55:39 PDT 2024


alx32 wrote:

> the test does not check that the line-table labels are emitted in the right places

I wanted to test them as they would be used in the future - via relative offsets to the line table start. So for example for `my_label_02` which should point to column 2: (`.loc	1 1 2`)  we have in the test:

```
  movq    %rax, my_label_02-.Lline_table_start0
```
And then the tests checks that this gets assembled to:
```
# CHECK-ASM-NEXT:     movq    %rax, 0x3b
```
And the test also checks that offset 0x3b in the line table is indeed column 2:
```
# CHECK-LINE-TABLE-NEXT: 0x0000003b: 05 DW_LNS_set_column (2)
```

I can add additional tests using `llvm-objdump --syms` but I think they would be checking the same thing again. Or should we add this test to make sure the syms end up in the symtab ? 

https://github.com/llvm/llvm-project/pull/99710


More information about the llvm-commits mailing list