xref: /llvm-project/llvm/test/tools/llvm-dwarfdump/X86/debug_line_short_prologue_v4.s (revision c475856d0532995a74206e5f4bd5ebf80ce85750)
1## Test cases when we run into the end of section while parsing a line table
2## prologue.
3
4# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj --defsym CASE=0 -o %t0
5# RUN: llvm-dwarfdump -debug-line %t0 2>&1 | FileCheck %s --check-prefixes=ALL,C0
6
7# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj --defsym CASE=1 -o %t1
8# RUN: llvm-dwarfdump -debug-line %t1 2>&1 | FileCheck %s --check-prefixes=ALL,C1
9
10# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj --defsym CASE=2 -o %t2
11# RUN: llvm-dwarfdump -debug-line %t2 2>&1 | FileCheck %s --check-prefixes=ALL,C1
12
13# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj --defsym CASE=3 -o %t3
14# RUN: llvm-dwarfdump -debug-line %t3 2>&1 | FileCheck %s --check-prefixes=ALL,C1
15
16# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj --defsym CASE=4 -o %t4
17# RUN: llvm-dwarfdump -debug-line %t4 2>&1 | FileCheck %s --check-prefixes=ALL,C1
18
19# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj --defsym CASE=5 -o %t5
20# RUN: llvm-dwarfdump -debug-line %t5 2>&1 | FileCheck %s --check-prefixes=ALL,OK
21
22# ALL:      debug_line[0x00000000]
23
24# C0-NEXT:  warning: parsing line table prologue at 0x00000000 found an invalid directory or file table description at 0x00000021
25# C0-NEXT:  warning: include directories table was not null terminated before the end of the prologue
26# C0:       include_directories[  1] = "dir1"
27
28# C1-NEXT:  warning: parsing line table prologue at 0x00000000 found an invalid directory or file table description
29# C1-NEXT:  warning: file names table was not null terminated before the end of the prologue
30# C1:       include_directories[  2] = "dir2"
31# C1-NEXT:  file_names[  1]:
32# C1-NEXT:             name: "file1"
33# C1-NEXT:        dir_index: 1
34# C1-NEXT:         mod_time: 0x00000002
35# C1-NEXT:           length: 0x00000003
36
37# OK:       file_names[  2]:
38# OK-NEXT:             name: "file2"
39# OK-NEXT:        dir_index: 1
40# OK-NEXT:         mod_time: 0x00000005
41# OK-NEXT:           length: 0x00000006
42
43.section .debug_line,"",@progbits
44.long   .Lend-.Lstart   # Length of Unit
45.Lstart:
46.short  4               # DWARF version number
47.long   .Lprologue_end-.Lprologue_start  # Length of Prologue
48.Lprologue_start:
49.byte   1               # Minimum Instruction Length
50.byte   1               # Maximum Operations per Instruction
51.byte   1               # Default is_stmt
52.byte   -5              # Line Base
53.byte   14              # Line Range
54.byte   13              # Opcode Base
55.byte   0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 # Standard Opcode Lengths
56.asciz "dir1"           # Include table
57.if CASE >= 1
58.asciz "dir2"
59.byte   0
60.asciz "file1"          # File table
61.byte   1, 2, 3
62.if CASE >= 2
63.asciz "file2"
64.if CASE >= 3
65.byte 1
66.if CASE >= 4
67.byte 5
68.if CASE >= 5
69.byte 6
70.byte 0
71.endif
72.endif
73.endif
74.endif
75.endif
76
77.Lprologue_end:
78.Lend:
79