[llvm] a3f58f3 - [NFC][DebugInfo] Expand coverage of a RISCV test
Jeremy Morse via llvm-commits
llvm-commits at lists.llvm.org
Thu May 8 02:43:56 PDT 2025
Author: Jeremy Morse
Date: 2025-05-08T10:41:56+01:00
New Revision: a3f58f3c84901afe296718863aceca45e7a8a86a
URL: https://github.com/llvm/llvm-project/commit/a3f58f3c84901afe296718863aceca45e7a8a86a
DIFF: https://github.com/llvm/llvm-project/commit/a3f58f3c84901afe296718863aceca45e7a8a86a.diff
LOG: [NFC][DebugInfo] Expand coverage of a RISCV test
This is a pre-commit for a patch (#134677) -- the test behaviour is not
being changed, instead I've added "-v" to the llvm-dwarfdump commandline
for --debug-line. This prints out how the linetable is encoded, not just
what the linetable means, and it's important to illustrate that in the
upcoming patch. I've separated out the llvm-dwarfdump line for .debug_info
so that it's not affected by adding -v.
Added:
Modified:
llvm/test/DebugInfo/RISCV/dwarf-riscv-relocs.ll
Removed:
################################################################################
diff --git a/llvm/test/DebugInfo/RISCV/dwarf-riscv-relocs.ll b/llvm/test/DebugInfo/RISCV/dwarf-riscv-relocs.ll
index 14cb4b386a369..548cf2daa9d8d 100644
--- a/llvm/test/DebugInfo/RISCV/dwarf-riscv-relocs.ll
+++ b/llvm/test/DebugInfo/RISCV/dwarf-riscv-relocs.ll
@@ -1,8 +1,10 @@
; RUN: llc -filetype=obj -mtriple=riscv32 -mattr=+relax %s -o %t.o
; RUN: llvm-readobj -r %t.o | FileCheck -check-prefix=READOBJ-RELOCS %s
; RUN: llvm-objdump --source %t.o | FileCheck --check-prefix=OBJDUMP-SOURCE %s
-; RUN: llvm-dwarfdump --debug-info --debug-line %t.o | \
+; RUN: llvm-dwarfdump --debug-info %t.o | \
; RUN: FileCheck -check-prefix=DWARF-DUMP %s
+; RUN: llvm-dwarfdump --debug-line -v %t.o | \
+; RUN: FileCheck -check-prefix=LINE-DUMP %s
; Check that we actually have relocations, otherwise this is kind of pointless.
; READOBJ-RELOCS: Section ({{.*}}) .rela.debug_info {
@@ -33,46 +35,61 @@
; DWARF-DUMP: DW_AT_encoding (DW_ATE_signed)
; DWARF-DUMP: DW_AT_byte_size (0x04)
-; DWARF-DUMP: .debug_line contents:
-; DWARF-DUMP-NEXT: debug_line[0x00000000]
-; DWARF-DUMP-NEXT: Line table prologue:
-; DWARF-DUMP-NEXT: total_length: 0x00000067
-; DWARF-DUMP-NEXT: format: DWARF32
-; DWARF-DUMP-NEXT: version: 5
-; DWARF-DUMP-NEXT: address_size: 4
-; DWARF-DUMP-NEXT: seg_select_size: 0
-; DWARF-DUMP-NEXT: prologue_length: 0x0000003e
-; DWARF-DUMP-NEXT: min_inst_length: 1
-; DWARF-DUMP-NEXT: max_ops_per_inst: 1
-; DWARF-DUMP-NEXT: default_is_stmt: 1
-; DWARF-DUMP-NEXT: line_base: -5
-; DWARF-DUMP-NEXT: line_range: 14
-; DWARF-DUMP-NEXT: opcode_base: 13
-; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_copy] = 0
-; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_advance_pc] = 1
-; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_advance_line] = 1
-; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_file] = 1
-; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_column] = 1
-; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_negate_stmt] = 0
-; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_basic_block] = 0
-; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_const_add_pc] = 0
-; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 1
-; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_prologue_end] = 0
-; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_epilogue_begin] = 0
-; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_isa] = 1
-; DWARF-DUMP-NEXT: include_directories[ 0] = "."
-; DWARF-DUMP-NEXT: file_names[ 0]:
-; DWARF-DUMP-NEXT: name: "dwarf-riscv-relocs.c"
-; DWARF-DUMP-NEXT: dir_index: 0
-; DWARF-DUMP-NEXT: md5_checksum: 05ab89f5481bc9f2d037e7886641e919
-; DWARF-DUMP-NEXT: source: "int main()\n{\n return 0;\n}\n"
-; DWARF-DUMP-EMPTY:
-; DWARF-DUMP-NEXT: Address Line Column File ISA Discriminator OpIndex Flags
-; DWARF-DUMP-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------
-; DWARF-DUMP-NEXT: 0x0000000000000000 2 0 0 0 0 0 is_stmt
-; DWARF-DUMP-NEXT: 0x000000000000001c 3 5 0 0 0 0 is_stmt prologue_end
-; DWARF-DUMP-NEXT: 0x0000000000000020 3 5 0 0 0 0 epilogue_begin
-; DWARF-DUMP-NEXT: 0x0000000000000030 3 5 0 0 0 0 end_sequence
+; LINE-DUMP: .debug_line contents:
+; LINE-DUMP-NEXT: debug_line[0x00000000]
+; LINE-DUMP-NEXT: Line table prologue:
+; LINE-DUMP-NEXT: total_length: 0x00000067
+; LINE-DUMP-NEXT: format: DWARF32
+; LINE-DUMP-NEXT: version: 5
+; LINE-DUMP-NEXT: address_size: 4
+; LINE-DUMP-NEXT: seg_select_size: 0
+; LINE-DUMP-NEXT: prologue_length: 0x0000003e
+; LINE-DUMP-NEXT: min_inst_length: 1
+; LINE-DUMP-NEXT: max_ops_per_inst: 1
+; LINE-DUMP-NEXT: default_is_stmt: 1
+; LINE-DUMP-NEXT: line_base: -5
+; LINE-DUMP-NEXT: line_range: 14
+; LINE-DUMP-NEXT: opcode_base: 13
+; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_copy] = 0
+; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_advance_pc] = 1
+; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_advance_line] = 1
+; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_file] = 1
+; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_column] = 1
+; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_negate_stmt] = 0
+; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_basic_block] = 0
+; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_const_add_pc] = 0
+; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 1
+; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_prologue_end] = 0
+; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_epilogue_begin] = 0
+; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_isa] = 1
+; LINE-DUMP-NEXT: include_directories[ 0] = .debug_line_str[0x00000000] = "."
+; LINE-DUMP-NEXT: file_names[ 0]:
+; LINE-DUMP-NEXT: name: .debug_line_str[0x00000002] = "dwarf-riscv-relocs.c"
+; LINE-DUMP-NEXT: dir_index: 0
+; LINE-DUMP-NEXT: md5_checksum: 05ab89f5481bc9f2d037e7886641e919
+; LINE-DUMP-NEXT: source: .debug_line_str[0x00000017] = "int main()\n{\n return 0;\n}\n"
+; LINE-DUMP-EMPTY:
+; LINE-DUMP-NEXT: Address Line Column File ISA Discriminator OpIndex Flags
+; LINE-DUMP-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------
+; LINE-DUMP-NEXT:0x0000004a: 04 DW_LNS_set_file (0)
+; LINE-DUMP-NEXT:0x0000004c: 00 DW_LNE_set_address (0x00000000)
+; LINE-DUMP-NEXT:0x00000053: 13 address += 0, line += 1, op-index += 0
+; LINE-DUMP-NEXT: 0x0000000000000000 2 0 0 0 0 0 is_stmt
+; LINE-DUMP-NEXT:0x00000054: 05 DW_LNS_set_column (5)
+; LINE-DUMP-NEXT:0x00000056: 0a DW_LNS_set_prologue_end
+; LINE-DUMP-NEXT:0x00000057: 03 DW_LNS_advance_line (3)
+; LINE-DUMP-NEXT:0x00000059: 09 DW_LNS_fixed_advance_pc (addr += 0x001c, op-index = 0)
+; LINE-DUMP-NEXT:0x0000005c: 01 DW_LNS_copy
+; LINE-DUMP-NEXT: 0x000000000000001c 3 5 0 0 0 0 is_stmt prologue_end
+; LINE-DUMP-NEXT:0x0000005d: 06 DW_LNS_negate_stmt
+; LINE-DUMP-NEXT:0x0000005e: 0b DW_LNS_set_epilogue_begin
+; LINE-DUMP-NEXT:0x0000005f: 03 DW_LNS_advance_line (3)
+; LINE-DUMP-NEXT:0x00000061: 09 DW_LNS_fixed_advance_pc (addr += 0x0004, op-index = 0)
+; LINE-DUMP-NEXT:0x00000064: 01 DW_LNS_copy
+; LINE-DUMP-NEXT: 0x0000000000000020 3 5 0 0 0 0 epilogue_begin
+; LINE-DUMP-NEXT:0x00000065: 09 DW_LNS_fixed_advance_pc (addr += 0x0010, op-index = 0)
+; LINE-DUMP-NEXT:0x00000068: 00 DW_LNE_end_sequence
+; LINE-DUMP-NEXT: 0x0000000000000030 3 5 0 0 0 0 end_sequence
; ModuleID = 'dwarf-riscv-relocs.c'
source_filename = "dwarf-riscv-relocs.c"
More information about the llvm-commits
mailing list