xref: /llvm-project/llvm/test/tools/llvm-dwarfdump/X86/debug_line_many_files_v5.s (revision d381b6a8d3e87d65f4ae9ca4d4333203e01825f5)
1## An object with many files and directories in a single debug_line contribution
2## meant to test the handling of directory_count and file_name_count fields.
3
4# RUN: llvm-mc -triple x86_64-pc-linux -filetype=obj %s -o %t
5# RUN: llvm-dwarfdump -debug-line %t | FileCheck %s
6
7# CHECK:      include_directories[  0] = "/d000"
8# CHECK:      include_directories[299] = "/d299"
9# CHECK:      file_names[  0]:
10# CHECK-NEXT:            name: "000.c"
11# CHECK-NEXT:       dir_index: 0
12# CHECK:      file_names[299]:
13# CHECK-NEXT:            name: "299.c"
14# CHECK-NEXT:       dir_index: 299
15
16.section .debug_line,"",@progbits
17.long   .Lunit_end0-.Lunit_start0   # Length of Unit
18.Lunit_start0:
19.short  5               # DWARF version number
20.byte   8               # Address Size
21.byte   0               # Segment Selector Size
22.long   .Lunit_header_end0 - .Lunit_params0 # Length of Prologue (invalid)
23.Lunit_params0:
24.byte   1               # Minimum Instruction Length
25.byte   1               # Maximum Operations per Instruction
26.byte   1               # Default is_stmt
27.byte   -5              # Line Base
28.byte   14              # Line Range
29.byte   13              # Opcode Base
30.byte   0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # Standard Opcode Lengths
31
32# Directory table format
33.byte   1               # One element per directory entry
34.byte   1               # DW_LNCT_path
35.byte   0x08            # DW_FORM_string
36
37# Directory table entries
38.uleb128 300            # 300 directories
39.irpc a,012
40.irpc b,0123456789
41.irpc c,0123456789
42.byte '/', 'd', '0'+\a, '0'+\b, '0'+\c, 0
43.endr
44.endr
45.endr
46
47# File table format
48.byte   2               # 2 elements per file entry
49.byte   1               # DW_LNCT_path
50.byte   0x08            # DW_FORM_string
51.byte   2               # DW_LNCT_directory_index
52.byte   0x05            # DW_FORM_data2
53
54# File table entries
55.uleb128 300            # 300 files
56.irpc a,012
57.irpc b,0123456789
58.irpc c,0123456789
59.byte '0'+\a, '0'+\b, '0'+\c, '.', 'c', 0 # File name
60.word \a*100+\b*10+\c   # Dir index
61.endr
62.endr
63.endr
64
65.Lunit_header_end0:
66.byte   0, 1, 1         # DW_LNE_end_sequence
67.Lunit_end0:
68