OSDN Git Service

[DWARF v5] Refactor range lists dumping by using a more generic way of handling table...
[android-x86/external-llvm.git] / test / tools / llvm-dwarfdump / X86 / debug_rnglists.s
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
5
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
8
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
11
12 # BOTH-NEXT:    ranges:
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>
18
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 ]
25
26 # TERSE-NEXT:   range list header: length = 0x0000002b, version = 0x0005, addr_size = 0x04, seg_size = 0x00, offset_entry_count = 0x00000002
27
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
30
31 # BOTH-NEXT:    offsets: [
32 # BOTH-NEXT:      0x00000008
33 # VERBOSE-SAME:   => 0x0000004f
34 # BOTH-NEXT:      0x0000001b
35 # VERBOSE-SAME:   => 0x00000062
36 # BOTH-NEXT:    ]
37 # BOTH-NEXT:    ranges:
38
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>
44
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 ]
50
51 # TERSE-NEXT:   range list header: length = 0x00000008, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
52
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
55
56 # BOTH-NOT:     offsets:
57 # BOTH:         ranges:
58 # BOTH-NOT:     [
59
60 # TERSE-NEXT:   range list header: length = 0x0000000e, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
61
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
64
65 # BOTH-NEXT:    ranges:
66 # TERSE-NEXT:   [0x0000000000000800, 0x0000000000001000)
67 # TERSE-NEXT:   <End of list>
68
69 # VERBOSE-NEXT: 0x000000b1: [DW_RLE_offset_pair]:  0x0000000000000800, 0x0000000000001000 =>
70 # VERBOSE-SAME:                                   [0x0000000000000800, 0x0000000000001000)
71 # VERBOSE-NEXT: 0x000000b6: [DW_RLE_end_of_list]
72
73 # TERSE-NEXT:   range list header: length = 0x00000017, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
74
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
77
78 # BOTH-NEXT:    ranges:
79 # TERSE-NEXT:   [0x0000000000001800, 0x0000000000002000)
80 # TERSE-NEXT:   <End of list>
81
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 ]
86
87 # BOTH-NOT:     range list header:
88
89 # ERR-NOT:  error:
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
93 # ERR-NOT:  error:
94
95 .section .debug_rnglists,"",@progbits
96
97 # First table (tests DW_RLE_end_of_list, start_end, and start_length encodings)
98 .long 55 # Table length
99 .short 5 # Version
100 .byte 8  # Address size
101 .byte 0  # Segment selector size
102 .long 0  # Offset entry count
103
104 # First range list
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
111
112 # Second range list
113 .byte 6          # DW_RLE_start_end
114 .quad 0x100, 0x200 # Start, end address
115 .byte 0          # DW_RLE_end_of_list
116
117 # Second table (shows support for size 4 addresses)
118 .long 43 # Table length
119 .short 5 # Version
120 .byte 4  # Address size
121 .byte 0  # Segment selector size
122 .long 2  # Offset entry count
123
124 # Offset array
125 .long 8  # Offset Entry 0
126 .long 27 # Offset Entry 1
127
128 # First range list
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
134
135 # Second range 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
140
141 # Third (empty) table
142 .long 8  # Table length
143 .short 5 # Version
144 .byte 8  # Address size
145 .byte 0  # Segment selector size
146 .long 0  # Offset entry count
147
148 # The following entries are for encodings unsupported at the time of writing.
149 # The test should be updated as these encodings are supported.
150
151 # Fourth table (testing DW_RLE_base_addressx)
152 .long 11 # Table length
153 .short 5 # Version
154 .byte 8  # Address size
155 .byte 0  # Segment selector size
156 .long 0  # Offset entry count
157
158 # First range list
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
162
163 # Fifth table (testing DW_RLE_startx_endx)
164 .long 12 # Table length
165 .short 5 # Version
166 .byte 8  # Address size
167 .byte 0  # Segment selector size
168 .long 0  # Offset entry count
169
170 # First range list
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
175
176 # Sixth table (testing DW_RLE_startx_length)
177 .long 12 # Table length
178 .short 5 # Version
179 .byte 8  # Address size
180 .byte 0  # Segment selector size
181 .long 0  # Offset entry count
182
183 # First range list
184 .byte 3          # DW_RLE_startx_length
185 .byte 2            # Start address (index in .debug_addr)
186 .byte 42           # Length
187 .byte 0          # DW_RLE_end_of_list
188
189 # Seventh table (testing DW_RLE_offset_pair)
190 .long 14 # Table length
191 .short 5 # Version
192 .byte 8  # Address size
193 .byte 0  # Segment selector size
194 .long 0  # Offset entry count
195
196 # First range list
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
201
202 # Eigth table (testing DW_RLE_base_address and its impact
203 # on DW_RLE_offset_pair)
204 .long 23 # Table length
205 .short 5 # Version
206 .byte 8  # Address size
207 .byte 0  # Segment selector size
208 .long 0  # Offset entry count
209
210 # First range list
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