Skip to content

Commit a3f58f3

Browse files
committed
[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.
1 parent fc2ec06 commit a3f58f3

File tree

1 file changed

+58
-41
lines changed

1 file changed

+58
-41
lines changed

llvm/test/DebugInfo/RISCV/dwarf-riscv-relocs.ll

Lines changed: 58 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
; RUN: llc -filetype=obj -mtriple=riscv32 -mattr=+relax %s -o %t.o
22
; RUN: llvm-readobj -r %t.o | FileCheck -check-prefix=READOBJ-RELOCS %s
33
; RUN: llvm-objdump --source %t.o | FileCheck --check-prefix=OBJDUMP-SOURCE %s
4-
; RUN: llvm-dwarfdump --debug-info --debug-line %t.o | \
4+
; RUN: llvm-dwarfdump --debug-info %t.o | \
55
; RUN: FileCheck -check-prefix=DWARF-DUMP %s
6+
; RUN: llvm-dwarfdump --debug-line -v %t.o | \
7+
; RUN: FileCheck -check-prefix=LINE-DUMP %s
68

79
; Check that we actually have relocations, otherwise this is kind of pointless.
810
; READOBJ-RELOCS: Section ({{.*}}) .rela.debug_info {
@@ -33,46 +35,61 @@
3335
; DWARF-DUMP: DW_AT_encoding (DW_ATE_signed)
3436
; DWARF-DUMP: DW_AT_byte_size (0x04)
3537

36-
; DWARF-DUMP: .debug_line contents:
37-
; DWARF-DUMP-NEXT: debug_line[0x00000000]
38-
; DWARF-DUMP-NEXT: Line table prologue:
39-
; DWARF-DUMP-NEXT: total_length: 0x00000067
40-
; DWARF-DUMP-NEXT: format: DWARF32
41-
; DWARF-DUMP-NEXT: version: 5
42-
; DWARF-DUMP-NEXT: address_size: 4
43-
; DWARF-DUMP-NEXT: seg_select_size: 0
44-
; DWARF-DUMP-NEXT: prologue_length: 0x0000003e
45-
; DWARF-DUMP-NEXT: min_inst_length: 1
46-
; DWARF-DUMP-NEXT: max_ops_per_inst: 1
47-
; DWARF-DUMP-NEXT: default_is_stmt: 1
48-
; DWARF-DUMP-NEXT: line_base: -5
49-
; DWARF-DUMP-NEXT: line_range: 14
50-
; DWARF-DUMP-NEXT: opcode_base: 13
51-
; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_copy] = 0
52-
; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_advance_pc] = 1
53-
; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_advance_line] = 1
54-
; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_file] = 1
55-
; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_column] = 1
56-
; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_negate_stmt] = 0
57-
; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_basic_block] = 0
58-
; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_const_add_pc] = 0
59-
; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 1
60-
; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_prologue_end] = 0
61-
; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_epilogue_begin] = 0
62-
; DWARF-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_isa] = 1
63-
; DWARF-DUMP-NEXT: include_directories[ 0] = "."
64-
; DWARF-DUMP-NEXT: file_names[ 0]:
65-
; DWARF-DUMP-NEXT: name: "dwarf-riscv-relocs.c"
66-
; DWARF-DUMP-NEXT: dir_index: 0
67-
; DWARF-DUMP-NEXT: md5_checksum: 05ab89f5481bc9f2d037e7886641e919
68-
; DWARF-DUMP-NEXT: source: "int main()\n{\n return 0;\n}\n"
69-
; DWARF-DUMP-EMPTY:
70-
; DWARF-DUMP-NEXT: Address Line Column File ISA Discriminator OpIndex Flags
71-
; DWARF-DUMP-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------
72-
; DWARF-DUMP-NEXT: 0x0000000000000000 2 0 0 0 0 0 is_stmt
73-
; DWARF-DUMP-NEXT: 0x000000000000001c 3 5 0 0 0 0 is_stmt prologue_end
74-
; DWARF-DUMP-NEXT: 0x0000000000000020 3 5 0 0 0 0 epilogue_begin
75-
; DWARF-DUMP-NEXT: 0x0000000000000030 3 5 0 0 0 0 end_sequence
38+
; LINE-DUMP: .debug_line contents:
39+
; LINE-DUMP-NEXT: debug_line[0x00000000]
40+
; LINE-DUMP-NEXT: Line table prologue:
41+
; LINE-DUMP-NEXT: total_length: 0x00000067
42+
; LINE-DUMP-NEXT: format: DWARF32
43+
; LINE-DUMP-NEXT: version: 5
44+
; LINE-DUMP-NEXT: address_size: 4
45+
; LINE-DUMP-NEXT: seg_select_size: 0
46+
; LINE-DUMP-NEXT: prologue_length: 0x0000003e
47+
; LINE-DUMP-NEXT: min_inst_length: 1
48+
; LINE-DUMP-NEXT: max_ops_per_inst: 1
49+
; LINE-DUMP-NEXT: default_is_stmt: 1
50+
; LINE-DUMP-NEXT: line_base: -5
51+
; LINE-DUMP-NEXT: line_range: 14
52+
; LINE-DUMP-NEXT: opcode_base: 13
53+
; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_copy] = 0
54+
; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_advance_pc] = 1
55+
; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_advance_line] = 1
56+
; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_file] = 1
57+
; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_column] = 1
58+
; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_negate_stmt] = 0
59+
; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_basic_block] = 0
60+
; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_const_add_pc] = 0
61+
; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 1
62+
; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_prologue_end] = 0
63+
; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_epilogue_begin] = 0
64+
; LINE-DUMP-NEXT: standard_opcode_lengths[DW_LNS_set_isa] = 1
65+
; LINE-DUMP-NEXT: include_directories[ 0] = .debug_line_str[0x00000000] = "."
66+
; LINE-DUMP-NEXT: file_names[ 0]:
67+
; LINE-DUMP-NEXT: name: .debug_line_str[0x00000002] = "dwarf-riscv-relocs.c"
68+
; LINE-DUMP-NEXT: dir_index: 0
69+
; LINE-DUMP-NEXT: md5_checksum: 05ab89f5481bc9f2d037e7886641e919
70+
; LINE-DUMP-NEXT: source: .debug_line_str[0x00000017] = "int main()\n{\n return 0;\n}\n"
71+
; LINE-DUMP-EMPTY:
72+
; LINE-DUMP-NEXT: Address Line Column File ISA Discriminator OpIndex Flags
73+
; LINE-DUMP-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------
74+
; LINE-DUMP-NEXT:0x0000004a: 04 DW_LNS_set_file (0)
75+
; LINE-DUMP-NEXT:0x0000004c: 00 DW_LNE_set_address (0x00000000)
76+
; LINE-DUMP-NEXT:0x00000053: 13 address += 0, line += 1, op-index += 0
77+
; LINE-DUMP-NEXT: 0x0000000000000000 2 0 0 0 0 0 is_stmt
78+
; LINE-DUMP-NEXT:0x00000054: 05 DW_LNS_set_column (5)
79+
; LINE-DUMP-NEXT:0x00000056: 0a DW_LNS_set_prologue_end
80+
; LINE-DUMP-NEXT:0x00000057: 03 DW_LNS_advance_line (3)
81+
; LINE-DUMP-NEXT:0x00000059: 09 DW_LNS_fixed_advance_pc (addr += 0x001c, op-index = 0)
82+
; LINE-DUMP-NEXT:0x0000005c: 01 DW_LNS_copy
83+
; LINE-DUMP-NEXT: 0x000000000000001c 3 5 0 0 0 0 is_stmt prologue_end
84+
; LINE-DUMP-NEXT:0x0000005d: 06 DW_LNS_negate_stmt
85+
; LINE-DUMP-NEXT:0x0000005e: 0b DW_LNS_set_epilogue_begin
86+
; LINE-DUMP-NEXT:0x0000005f: 03 DW_LNS_advance_line (3)
87+
; LINE-DUMP-NEXT:0x00000061: 09 DW_LNS_fixed_advance_pc (addr += 0x0004, op-index = 0)
88+
; LINE-DUMP-NEXT:0x00000064: 01 DW_LNS_copy
89+
; LINE-DUMP-NEXT: 0x0000000000000020 3 5 0 0 0 0 epilogue_begin
90+
; LINE-DUMP-NEXT:0x00000065: 09 DW_LNS_fixed_advance_pc (addr += 0x0010, op-index = 0)
91+
; LINE-DUMP-NEXT:0x00000068: 00 DW_LNE_end_sequence
92+
; LINE-DUMP-NEXT: 0x0000000000000030 3 5 0 0 0 0 end_sequence
7693

7794
; ModuleID = 'dwarf-riscv-relocs.c'
7895
source_filename = "dwarf-riscv-relocs.c"

0 commit comments

Comments
 (0)