1 # This test verifies that: if a parent die(DW_TAG_subprogram) has zero
2 # length address range and has a child with normal address range then
3 # the "DIE address ranges are not contained in its parent's ranges"
4 # error is reported. It also checks that if a parent die has zero
5 # length address range and has children with overlapped addresses
6 # then the error "DIEs have overlapping address ranges" is reported.
8 # The DWARF looks like:
9 # 0x0000000b: DW_TAG_compile_unit
10 # DW_AT_name [DW_FORM_strp] ("/tmp/main.c")
11 # DW_AT_language (DW_LANG_C)
12 # DW_AT_low_pc (0x0000000000000000)
13 # DW_AT_ranges (0x00000000
14 # [0x0000000000001000, 0x0000000000002000))
16 # 0x0000001e: DW_TAG_subprogram
18 # DW_AT_low_pc (0x0000000000000000)
19 # DW_AT_high_pc (0x0000000000000000)
21 # 0x00000033: DW_TAG_lexical_block
22 # DW_AT_low_pc (0x0000000000001000)
23 # DW_AT_high_pc (0x0000000000002000)
25 # 0x00000044: DW_TAG_lexical_block
26 # DW_AT_low_pc (0x0000000000001000)
27 # DW_AT_high_pc (0x0000000000002000)
33 # RUN: yaml2obj %s | not llvm-dwarfdump --verify - | FileCheck %s --implicit-check-not=error:
35 # CHECK: Verifying -: file format Mach-O 64-bit x86-64
36 # CHECK: Verifying .debug_abbrev...
37 # CHECK: Verifying .debug_info Unit Header Chain...
38 # CHECK: error: DIE address ranges are not contained in its parent's ranges:
39 # CHECK: 0x0000001e: DW_TAG_subprogram
40 # CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000000d] = "main")
41 # CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
42 # CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000000000000)
44 # CHECK: 0x00000033: DW_TAG_lexical_block
45 # CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000001000)
46 # CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000000002000)
48 # CHECK: error: DIEs have overlapping address ranges:
49 # CHECK: 0x00000044: DW_TAG_lexical_block
50 # CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000001000)
51 # CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000000002000)
53 # CHECK: 0x00000033: DW_TAG_lexical_block
54 # CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000001000)
55 # CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000000002000)
57 # CHECK: error: DIE address ranges are not contained in its parent's ranges:
58 # CHECK: 0x0000001e: DW_TAG_subprogram
59 # CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000000d] = "main")
60 # CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
61 # CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000000000000)
63 # CHECK: 0x00000044: DW_TAG_lexical_block
64 # CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000001000)
65 # CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000000002000)
72 cpusubtype: 0x00000003
91 - sectname: __debug_abbrev
93 addr: 0x0000000000000000
100 reserved1: 0x00000000
101 reserved2: 0x00000000
102 reserved3: 0x00000000
103 - sectname: __debug_info
105 addr: 0x0000000000000024
112 reserved1: 0x00000000
113 reserved2: 0x00000000
114 reserved3: 0x00000000
115 - sectname: __debug_ranges
117 addr: 0x000000000000008B
124 reserved1: 0x00000000
125 reserved2: 0x00000000
126 reserved3: 0x00000000
127 - sectname: __debug_str
129 addr: 0x00000000000000DB
136 reserved1: 0x00000000
137 reserved2: 0x00000000
138 reserved3: 0x00000000
145 - cmd: LC_BUILD_VERSION
154 - cmd: LC_DATA_IN_CODE
175 Tag: DW_TAG_compile_unit
176 Children: DW_CHILDREN_yes
178 - Attribute: DW_AT_name
180 - Attribute: DW_AT_language
182 - Attribute: DW_AT_low_pc
184 - Attribute: DW_AT_ranges
185 Form: DW_FORM_sec_offset
187 Tag: DW_TAG_subprogram
188 Children: DW_CHILDREN_yes
190 - Attribute: DW_AT_name
192 - Attribute: DW_AT_low_pc
194 - Attribute: DW_AT_high_pc
197 Tag: DW_TAG_lexical_block
198 Children: DW_CHILDREN_no
200 - Attribute: DW_AT_low_pc
202 - Attribute: DW_AT_high_pc
209 - LowOffset: 0x0000000000001000
210 HighOffset: 0x0000000000002000
215 - AbbrCode: 0x00000001
217 - Value: 0x0000000000000001
218 - Value: 0x0000000000000002
219 - Value: 0x0000000000000000
220 - Value: 0x0000000000000000
221 - AbbrCode: 0x00000002
223 - Value: 0x000000000000000D
224 - Value: 0x0000000000000000
225 - Value: 0x0000000000000000
226 - AbbrCode: 0x00000003
228 - Value: 0x0000000000001000
229 - Value: 0x0000000000002000
230 - AbbrCode: 0x00000003
232 - Value: 0x0000000000001000
233 - Value: 0x0000000000002000
234 - AbbrCode: 0x00000000
235 - AbbrCode: 0x00000000