1 # RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o %t.o
2 # RUN: llvm-dwarfdump --debug-rnglists %t.o 2> %t.err | FileCheck %s --check-prefixes=TERSE,BOTH
3 # RUN: FileCheck %s --input-file %t.err --check-prefix=ERR
4 # RUN: llvm-dwarfdump -v --debug-rnglists %t.o 2> %t.err | FileCheck %s --check-prefixes=VERBOSE,BOTH
6 # BOTH: .debug_rnglists contents:
7 # TERSE-NEXT: range list header: length = 0x00000037, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
9 # VERBOSE-NEXT: 0x{{[0-9a-f]*}}:
10 # VERBOSE-SAME: range list header: length = 0x00000037, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
13 # TERSE-NEXT: [0x0000000000000010, 0x0000000000000020)
14 # TERSE-NEXT: [0x0000000000000025, 0x00000000000000a5)
15 # TERSE-NEXT: <End of list>
16 # TERSE-NEXT: [0x0000000000000100, 0x0000000000000200)
17 # TERSE-NEXT: <End of list>
19 # VERBOSE-NEXT: 0x0000000c: [DW_RLE_start_end ]: [0x0000000000000010, 0x0000000000000020)
20 # VERBOSE-NEXT: 0x0000001d: [DW_RLE_start_length]: 0x0000000000000025, 0x0000000000000080
21 # VERBOSE-SAME: => [0x0000000000000025, 0x00000000000000a5)
22 # VERBOSE-NEXT: 0x00000028: [DW_RLE_end_of_list ]
23 # VERBOSE-NEXT: 0x00000029: [DW_RLE_start_end ]: [0x0000000000000100, 0x0000000000000200)
24 # VERBOSE-NEXT: 0x0000003a: [DW_RLE_end_of_list ]
26 # TERSE-NEXT: range list header: length = 0x0000002b, version = 0x0005, addr_size = 0x04, seg_size = 0x00, offset_entry_count = 0x00000002
28 # VERBOSE-NEXT: 0x{{[0-9a-f]*}}:
29 # VERBOSE-SAME: range list header: length = 0x0000002b, version = 0x0005, addr_size = 0x04, seg_size = 0x00, offset_entry_count = 0x00000002
31 # BOTH-NEXT: offsets: [
32 # BOTH-NEXT: 0x00000008
33 # VERBOSE-SAME: => 0x0000004f
34 # BOTH-NEXT: 0x0000001b
35 # VERBOSE-SAME: => 0x00000062
39 # TERSE-NEXT: [0x00000000, 0x00000000)
40 # TERSE-NEXT: [0x00000002, 0x00000006)
41 # TERSE-NEXT: <End of list>
42 # TERSE-NEXT: [0x00000036, 0x00000136)
43 # TERSE-NEXT: <End of list>
45 # VERBOSE-NEXT: 0x0000004f: [DW_RLE_start_end ]: [0x00000000, 0x00000000)
46 # VERBOSE-NEXT: 0x00000058: [DW_RLE_start_end ]: [0x00000002, 0x00000006)
47 # VERBOSE-NEXT: 0x00000061: [DW_RLE_end_of_list ]
48 # VERBOSE-NEXT: 0x00000062: [DW_RLE_start_length]: 0x00000036, 0x00000100 => [0x00000036, 0x00000136)
49 # VERBOSE-NEXT: 0x00000069: [DW_RLE_end_of_list ]
51 # TERSE-NEXT: range list header: length = 0x00000008, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
53 # VERBOSE-NEXT: 0x{{[0-9a-f]*}}:
54 # VERBOSE-SAME: range list header: length = 0x00000008, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
60 # TERSE-NEXT: range list header: length = 0x0000000b, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
62 # VERBOSE-NEXT: 0x{{[0-9a-f]*}}:
63 # VERBOSE-SAME: range list header: length = 0x0000000b, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
66 # TERSE-NEXT: <End of list>
68 # VERBOSE-NEXT: 0x00000082: [DW_RLE_base_addressx]: 0x0000000000000000
69 # VERBOSE-NEXT: 0x00000084: [DW_RLE_end_of_list ]
71 # TERSE-NEXT: range list header: length = 0x0000000c, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
73 # VERBOSE-NEXT: 0x{{[0-9a-f]*}}:
74 # VERBOSE-SAME: range list header: length = 0x0000000c, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
77 # TERSE-NEXT: [0x0000000000000000, 0x000000000000002a)
78 # TERSE-NEXT: <End of list>
80 # VERBOSE-NEXT: 0x000000a1: [DW_RLE_startx_length]: 0x0000000000000002, 0x000000000000002a => [0x0000000000000000, 0x000000000000002a)
81 # VERBOSE-NEXT: 0x000000a4: [DW_RLE_end_of_list ]
83 # TERSE-NEXT: range list header: length = 0x0000000e, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
85 # VERBOSE-NEXT: 0x{{[0-9a-f]*}}:
86 # VERBOSE-SAME: range list header: length = 0x0000000e, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
89 # TERSE-NEXT: [0x0000000000000800, 0x0000000000001000)
90 # TERSE-NEXT: <End of list>
92 # VERBOSE-NEXT: 0x000000b1: [DW_RLE_offset_pair]: 0x0000000000000800, 0x0000000000001000 =>
93 # VERBOSE-SAME: [0x0000000000000800, 0x0000000000001000)
94 # VERBOSE-NEXT: 0x000000b6: [DW_RLE_end_of_list]
96 # TERSE-NEXT: range list header: length = 0x00000017, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
98 # VERBOSE-NEXT: 0x{{[0-9a-f]*}}:
99 # VERBOSE-SAME: range list header: length = 0x00000017, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
102 # TERSE-NEXT: [0x0000000000001800, 0x0000000000002000)
103 # TERSE-NEXT: <End of list>
105 # VERBOSE-NEXT: 0x000000c3: [DW_RLE_base_address]: 0x0000000000001000
106 # VERBOSE-NEXT: 0x000000cc: [DW_RLE_offset_pair ]: 0x0000000000000800, 0x0000000000001000 =>
107 # VERBOSE-SAME: [0x0000000000001800, 0x0000000000002000)
108 # VERBOSE-NEXT: 0x000000d1: [DW_RLE_end_of_list ]
110 # BOTH-NOT: range list header:
113 # ERR: error: unsupported rnglists encoding DW_RLE_startx_endx at offset 0x91
116 .section .debug_rnglists,"",@progbits
118 # First table (tests DW_RLE_end_of_list, start_end, and start_length encodings)
119 .long 55 # Table length
121 .byte 8 # Address size
122 .byte 0 # Segment selector size
123 .long 0 # Offset entry count
126 .byte 6 # DW_RLE_start_end
127 .quad 0x10, 0x20 # Start, end address
128 .byte 7 # DW_RLE_start_length
129 .quad 0x25 # Start address
130 .byte 0x80, 0x01 # Length
131 .byte 0 # DW_RLE_end_of_list
134 .byte 6 # DW_RLE_start_end
135 .quad 0x100, 0x200 # Start, end address
136 .byte 0 # DW_RLE_end_of_list
138 # Second table (shows support for size 4 addresses)
139 .long 43 # Table length
141 .byte 4 # Address size
142 .byte 0 # Segment selector size
143 .long 2 # Offset entry count
146 .long 8 # Offset Entry 0
147 .long 27 # Offset Entry 1
150 .byte 6 # DW_RLE_start_end
151 .long 0, 0 # Start, end address
152 .byte 6 # DW_RLE_start_end
153 .long 0x2, 0x6 # Start, end address
154 .byte 0 # DW_RLE_end_of_list
157 .byte 7 # DW_RLE_start_length
158 .long 0x36 # Start address
159 .byte 0x80, 0x02 # Length
160 .byte 0 # DW_RLE_end_of_list
162 # Third (empty) table
163 .long 8 # Table length
165 .byte 8 # Address size
166 .byte 0 # Segment selector size
167 .long 0 # Offset entry count
169 # The following entries are for encodings unsupported at the time of writing.
170 # The test should be updated as these encodings are supported.
172 # Fourth table (testing DW_RLE_base_addressx)
173 .long 11 # Table length
175 .byte 8 # Address size
176 .byte 0 # Segment selector size
177 .long 0 # Offset entry count
180 .byte 1 # DW_RLE_base_addressx
181 .byte 0 # Base address (index 0 in .debug_addr)
182 .byte 0 # DW_RLE_end_of_list
184 # Fifth table (testing DW_RLE_startx_endx)
185 .long 12 # Table length
187 .byte 8 # Address size
188 .byte 0 # Segment selector size
189 .long 0 # Offset entry count
192 .byte 2 # DW_RLE_startx_endx
193 .byte 1 # Start address (index in .debug_addr)
194 .byte 10 # End address (index in .debug_addr)
195 .byte 0 # DW_RLE_end_of_list
197 # Sixth table (testing DW_RLE_startx_length)
198 .long 12 # Table length
200 .byte 8 # Address size
201 .byte 0 # Segment selector size
202 .long 0 # Offset entry count
205 .byte 3 # DW_RLE_startx_length
206 .byte 2 # Start address (index in .debug_addr)
208 .byte 0 # DW_RLE_end_of_list
210 # Seventh table (testing DW_RLE_offset_pair)
211 .long 14 # Table length
213 .byte 8 # Address size
214 .byte 0 # Segment selector size
215 .long 0 # Offset entry count
218 .byte 4 # DW_RLE_offset_pair
219 .byte 0x80, 0x10 # Start offset
220 .byte 0x80, 0x20 # End offset (index in .debug_addr)
221 .byte 0 # DW_RLE_end_of_list
223 # Eigth table (testing DW_RLE_base_address and its impact
224 # on DW_RLE_offset_pair)
225 .long 23 # Table length
227 .byte 8 # Address size
228 .byte 0 # Segment selector size
229 .long 0 # Offset entry count
232 .byte 5 # DW_RLE_base_address
233 .quad 0x1000 # Base address
234 .byte 4 # DW_RLE_offset_pair
235 .byte 0x80, 0x10 # Start offset
236 .byte 0x80, 0x20 # End offset
237 .byte 0 # DW_RLE_end_of_list