[llvm] [MC] Add .loc_label instruction (PR #99710)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 29 12:51:11 PDT 2024
================
@@ -0,0 +1,87 @@
+// Verify that the .loc_label instruction resets the line sequence and generates
+// the requested label at the correct position in the line stream
+
+// RUN: llvm-mc -filetype obj -triple x86_64-linux-elf %s -o %t.o
+// RUN: llvm-dwarfdump -v --debug-line %t.o | FileCheck %s --check-prefix=CHECK-LINE-TABLE
+// RUN: llvm-objdump -s -j .offset_02 -j .offset_03 -j .offset_05 %t.o | FileCheck %s --check-prefix=CHECK-SECTIONS
+
+
+
+# CHECK-LINE-TABLE: Address Line Column File ISA Discriminator OpIndex Flags
+# CHECK-LINE-TABLE-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------
+# CHECK-LINE-TABLE-NEXT: 0x00000028: 05 DW_LNS_set_column (1)
+# CHECK-LINE-TABLE-NEXT: 0x0000002a: 00 DW_LNE_set_address (0x0000000000000000)
+# CHECK-LINE-TABLE-NEXT: 0x00000035: 01 DW_LNS_copy
+# CHECK-LINE-TABLE-NEXT: 0x0000000000000000 1 1 1 0 0 0 is_stmt
+# CHECK-LINE-TABLE-NEXT: 0x00000036: 02 DW_LNS_advance_pc (addr += 33, op-index += 0)
+# CHECK-LINE-TABLE-NEXT: 0x00000038: 00 DW_LNE_end_sequence
+# CHECK-LINE-TABLE-NEXT: 0x0000000000000021 1 1 1 0 0 0 is_stmt end_sequence
+# CHECK-LINE-TABLE-NEXT: 0x0000003b: 05 DW_LNS_set_column (2)
+# CHECK-LINE-TABLE-NEXT: 0x0000003d: 00 DW_LNE_set_address (0x0000000000000008)
+# CHECK-LINE-TABLE-NEXT: 0x00000048: 01 DW_LNS_copy
+# CHECK-LINE-TABLE-NEXT: 0x0000000000000008 1 2 1 0 0 0 is_stmt
----------------
alx32 wrote:
I was thinking since `0x08` is in a new sequence (relative to `0x21`) - then this is OK and conforming to DWARF.
I think this is the default behavior for having an `end_sequence`- `DW_LNS_advance_pc ` to the end and then the `DW_LNE_end_sequence` is emitted.
If useful: [the disassembly](https://gist.github.com/alx32/7438ec0278de94917df4dfb351e7cbb4), [the line table without my changes](https://gist.github.com/alx32/13e3ef03d55d691e924dfa128ccdf447).
https://github.com/llvm/llvm-project/pull/99710
More information about the llvm-commits
mailing list