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 = 0x0000000e, 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 = 0x0000000e, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
66 # TERSE-NEXT: [0x0000000000000800, 0x0000000000001000)
67 # TERSE-NEXT: <End of list>
69 # VERBOSE-NEXT: 0x000000b1: [DW_RLE_offset_pair]: 0x0000000000000800, 0x0000000000001000 =>
70 # VERBOSE-SAME: [0x0000000000000800, 0x0000000000001000)
71 # VERBOSE-NEXT: 0x000000b6: [DW_RLE_end_of_list]
73 # TERSE-NEXT: range list header: length = 0x00000017, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
75 # VERBOSE-NEXT: 0x{{[0-9a-f]*}}:
76 # VERBOSE-SAME: range list header: length = 0x00000017, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
79 # TERSE-NEXT: [0x0000000000001800, 0x0000000000002000)
80 # TERSE-NEXT: <End of list>
82 # VERBOSE-NEXT: 0x000000c3: [DW_RLE_base_address]: 0x0000000000001000
83 # VERBOSE-NEXT: 0x000000cc: [DW_RLE_offset_pair ]: 0x0000000000000800, 0x0000000000001000 =>
84 # VERBOSE-SAME: [0x0000000000001800, 0x0000000000002000)
85 # VERBOSE-NEXT: 0x000000d1: [DW_RLE_end_of_list ]
87 # BOTH-NOT: range list header:
90 # ERR: error: unsupported rnglists encoding DW_RLE_base_addressx at offset 0x82
91 # ERR-NEXT: error: unsupported rnglists encoding DW_RLE_startx_endx at offset 0x91
92 # ERR-NEXT: error: unsupported rnglists encoding DW_RLE_startx_length at offset 0xa1
95 .section .debug_rnglists,"",@progbits
97 # First table (tests DW_RLE_end_of_list, start_end, and start_length encodings)
98 .long 55 # Table length
100 .byte 8 # Address size
101 .byte 0 # Segment selector size
102 .long 0 # Offset entry count
105 .byte 6 # DW_RLE_start_end
106 .quad 0x10, 0x20 # Start, end address
107 .byte 7 # DW_RLE_start_length
108 .quad 0x25 # Start address
109 .byte 0x80, 0x01 # Length
110 .byte 0 # DW_RLE_end_of_list
113 .byte 6 # DW_RLE_start_end
114 .quad 0x100, 0x200 # Start, end address
115 .byte 0 # DW_RLE_end_of_list
117 # Second table (shows support for size 4 addresses)
118 .long 43 # Table length
120 .byte 4 # Address size
121 .byte 0 # Segment selector size
122 .long 2 # Offset entry count
125 .long 8 # Offset Entry 0
126 .long 27 # Offset Entry 1
129 .byte 6 # DW_RLE_start_end
130 .long 0, 0 # Start, end address
131 .byte 6 # DW_RLE_start_end
132 .long 0x2, 0x6 # Start, end address
133 .byte 0 # DW_RLE_end_of_list
136 .byte 7 # DW_RLE_start_length
137 .long 0x36 # Start address
138 .byte 0x80, 0x02 # Length
139 .byte 0 # DW_RLE_end_of_list
141 # Third (empty) table
142 .long 8 # Table length
144 .byte 8 # Address size
145 .byte 0 # Segment selector size
146 .long 0 # Offset entry count
148 # The following entries are for encodings unsupported at the time of writing.
149 # The test should be updated as these encodings are supported.
151 # Fourth table (testing DW_RLE_base_addressx)
152 .long 11 # Table length
154 .byte 8 # Address size
155 .byte 0 # Segment selector size
156 .long 0 # Offset entry count
159 .byte 1 # DW_RLE_base_addressx
160 .byte 0 # Base address (index 0 in .debug_addr)
161 .byte 0 # DW_RLE_end_of_list
163 # Fifth table (testing DW_RLE_startx_endx)
164 .long 12 # Table length
166 .byte 8 # Address size
167 .byte 0 # Segment selector size
168 .long 0 # Offset entry count
171 .byte 2 # DW_RLE_startx_endx
172 .byte 1 # Start address (index in .debug_addr)
173 .byte 10 # End address (index in .debug_addr)
174 .byte 0 # DW_RLE_end_of_list
176 # Sixth table (testing DW_RLE_startx_length)
177 .long 12 # Table length
179 .byte 8 # Address size
180 .byte 0 # Segment selector size
181 .long 0 # Offset entry count
184 .byte 3 # DW_RLE_startx_length
185 .byte 2 # Start address (index in .debug_addr)
187 .byte 0 # DW_RLE_end_of_list
189 # Seventh table (testing DW_RLE_offset_pair)
190 .long 14 # Table length
192 .byte 8 # Address size
193 .byte 0 # Segment selector size
194 .long 0 # Offset entry count
197 .byte 4 # DW_RLE_offset_pair
198 .byte 0x80, 0x10 # Start offset
199 .byte 0x80, 0x20 # End offset (index in .debug_addr)
200 .byte 0 # DW_RLE_end_of_list
202 # Eigth table (testing DW_RLE_base_address and its impact
203 # on DW_RLE_offset_pair)
204 .long 23 # Table length
206 .byte 8 # Address size
207 .byte 0 # Segment selector size
208 .long 0 # Offset entry count
211 .byte 5 # DW_RLE_base_address
212 .quad 0x1000 # Base address
213 .byte 4 # DW_RLE_offset_pair
214 .byte 0x80, 0x10 # Start offset
215 .byte 0x80, 0x20 # End offset
216 .byte 0 # DW_RLE_end_of_list