Follow up to d0858bffa11, add missing REQUIRES x86
[llvm-project.git] / llvm / test / tools / llvm-dwarfdump / X86 / debug_rnglists_invalid.s
blobe02a8a5efcf05c8eadc58b84306d53e1295e3aec
1 # RUN: llvm-mc %S/Inputs/debug_rnglists_short_section.s -filetype obj -triple x86_64-pc-linux -o - | \
2 # RUN: not llvm-dwarfdump --debug-rnglists - 2>&1 | FileCheck %s --check-prefix=SHORT
3 # SHORT-NOT: error:
4 # SHORT-NOT: range list header
5 # SHORT: error: parsing .debug_rnglists table at offset 0x0: unexpected end of data at offset 0x3
6 # SHORT-NOT: range list header
7 # SHORT-NOT: error:
9 # RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o - | \
10 # RUN: not llvm-dwarfdump --debug-rnglists - 2> %t.err | FileCheck %s --check-prefix=GOOD
11 # RUN: FileCheck %s --input-file %t.err
13 # GOOD: .debug_rnglists contents:
14 # GOOD-NEXT: range list header: length = 0x0000001e, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000001
15 # GOOD-NEXT: offsets: [
16 # GOOD-NEXT: 0x00000004
17 # GOOD-NEXT: ]
18 # GOOD-NEXT: ranges:
19 # GOOD-NEXT: [0x0000000000000010, 0x0000000000000020)
20 # GOOD-NEXT: <End of list>
21 # GOOD-NEXT: range list header: length = 0x0000001a, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
22 # GOOD-NEXT: ranges:
23 # GOOD-NEXT: [0x0000000000000030, 0x0000000000000040)
24 # GOOD-NEXT: <End of list>
25 # GOOD-NOT: range list header
27 # CHECK-NOT: error:
28 # CHECK: error: .debug_rnglists table at offset 0x22 has too small length (0xb) to contain a complete header
29 # CHECK-NEXT: error: unrecognised .debug_rnglists table version 4 in table at offset 0x2d
30 # CHECK-NEXT: error: .debug_rnglists table at offset 0x39 has unsupported address size: 3
31 # CHECK-NEXT: error: .debug_rnglists table at offset 0x45 has unsupported segment selector size 4
32 # CHECK-NEXT: error: .debug_rnglists table at offset 0x51 has more offset entries (12345678) than there is space for
33 # CHECK-NEXT: error: read past end of table when reading DW_RLE_start_end encoding at offset 0x69
34 # CHECK-NEXT: error: read past end of table when reading DW_RLE_start_length encoding at offset 0x82
35 # CHECK-NEXT: error: unknown rnglists encoding 0x2a at offset 0x98
36 # CHECK-NEXT: error: no end of list marker detected at end of .debug_rnglists table starting at offset 0xaa
37 # CHECK-NEXT: error: section is not large enough to contain a .debug_rnglists table of length 0x1f at offset 0xe5
38 # CHECK-NOT: error:
40 .section .debug_rnglists,"",@progbits
42 # Table 1 (good)
43 .long 30 # Table length
44 .short 5 # Version
45 .byte 8 # Address size
46 .byte 0 # Segment selector size
47 .long 1 # Offset entry count
49 # Offsets
50 .long 4
52 # First range list
53 .byte 6 # DW_RLE_start_length
54 .quad 0x10, 0x20 # Encoding payload
55 .byte 0 # DW_RLE_end_of_list
57 # Table 2 (length too small for header)
58 .long 7 # Table length
59 .short 5 # Version
60 .byte 8 # Address size
61 .byte 0 # Segment selector size
62 .byte 0, 0, 0 # Truncated offset entry count
64 # Table 3 (unknown version)
65 .long 8 # Table length
66 .short 4 # Version
67 .byte 8 # Address size
68 .byte 0 # Segment selector size
69 .long 0 # Offset entry count
71 # Table 4 (unsupported address size)
72 .long 8 # Table length
73 .short 5 # Version
74 .byte 3 # Address size
75 .byte 0 # Segment selector size
76 .long 0 # Offset entry count
78 # Table 5 (unsupported segment selector size)
79 .long 8 # Table length
80 .short 5 # Version
81 .byte 8 # Address size
82 .byte 4 # Segment selector size
83 .long 0 # Offset entry count
85 # Table 6 (bad offset entry count)
86 .long 8 # Table length
87 .short 5 # Version
88 .byte 8 # Address size
89 .byte 0 # Segment selector size
90 .long 12345678 # Offset entry count
92 # Table 7 (malformed DW_RLE_start_end)
93 .long 21 # Table length
94 .short 5 # Version
95 .byte 8 # Address size
96 .byte 0 # Segment selector size
97 .long 0 # Offset entry count
99 # First range list
100 .byte 6 # DW_RLE_start_end
101 .quad 1 # Start address
102 .long 4 # Truncated end address
104 # Table 8 (malformed DW_RLE_start_length)
105 .long 18 # Table length
106 .short 5 # Version
107 .byte 8 # Address size
108 .byte 0 # Segment selector size
109 .long 0 # Offset entry count
111 # First range list
112 .byte 7 # DW_RLE_start_length
113 .quad 1 # Start address
114 .byte 0xFF # Length - invalid ULEB, so will continue reading past the end
116 # Table 9 (unknown encoding)
117 .long 26 # Table length
118 .short 5 # Version
119 .byte 8 # Address size
120 .byte 0 # Segment selector size
121 .long 0 # Offset entry count
123 # First range list
124 .byte 42 # Unknown encoding
125 .quad 0x10, 0x20 # Encoding payload
126 .byte 0 # DW_RLE_end_of_list
128 # Table 10 (missing end of list marker)
129 .long 25 # Table length
130 .short 5 # Version
131 .byte 8 # Address size
132 .byte 0 # Segment selector size
133 .long 0 # Offset entry count
135 # First range list
136 .byte 6 # DW_RLE_start_length
137 .quad 0x10, 0x20 # Encoding payload
139 # Table 11 (good)
140 .long 26 # Table length
141 .short 5 # Version
142 .byte 8 # Address size
143 .byte 0 # Segment selector size
144 .long 0 # Offset entry count
146 # First range list
147 .byte 6 # DW_RLE_start_length
148 .quad 0x30, 0x40 # Encoding payload
149 .byte 0 # DW_RLE_end_of_list
151 # Table 12 (length too long)
152 .long 27 # Table length - 1 greater than actual contents
153 .short 5 # Version
154 .byte 8 # Address size
155 .byte 0 # Segment selector size
156 .long 0 # Offset entry count
158 # First range list
159 .byte 6 # DW_RLE_start_end
160 .quad 1, 2 # Start, end address
161 .byte 0 # DW_RLE_end_of_list