Follow up to d0858bffa11, add missing REQUIRES x86
[llvm-project.git] / llvm / test / tools / llvm-dwarfdump / X86 / verify_parent_zero_length.yaml
blob5188ac5a6d407f68db88c36dfc58182321ae259d
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
17 #                 DW_AT_name      ("main")
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)
28 # 0x00000055:     NULL
30 # 0x00000056:   NULL
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)
68 --- !mach-o
69 FileHeader:
70   magic:           0xFEEDFACF
71   cputype:         0x01000007
72   cpusubtype:      0x00000003
73   filetype:        0x00000001
74   ncmds:           4
75   sizeofcmds:      464
76   flags:           0x00002000
77   reserved:        0x00000000
78 LoadCommands:
79   - cmd:             LC_SEGMENT_64
80     cmdsize:         392
81     segname:         ''
82     vmaddr:          0
83     vmsize:          261
84     fileoff:         528
85     filesize:        261
86     maxprot:         7
87     initprot:        7
88     nsects:          4
89     flags:           0
90     Sections:
91       - sectname:        __debug_abbrev
92         segname:         __DWARF
93         addr:            0x0000000000000000
94         size:            36
95         offset:          0x00000210
96         align:           0
97         reloff:          0x00000000
98         nreloc:          0
99         flags:           0x00000000
100         reserved1:       0x00000000
101         reserved2:       0x00000000
102         reserved3:       0x00000000
103       - sectname:        __debug_info
104         segname:         __DWARF
105         addr:            0x0000000000000024
106         size:            87
107         offset:          0x00000234
108         align:           0
109         reloff:          0x00000000
110         nreloc:          0
111         flags:           0x00000000
112         reserved1:       0x00000000
113         reserved2:       0x00000000
114         reserved3:       0x00000000
115       - sectname:        __debug_ranges
116         segname:         __DWARF
117         addr:            0x000000000000008B
118         size:            32
119         offset:          0x0000029B
120         align:           0
121         reloff:          0x00000000
122         nreloc:          0
123         flags:           0x00000000
124         reserved1:       0x00000000
125         reserved2:       0x00000000
126         reserved3:       0x00000000
127       - sectname:        __debug_str
128         segname:         __DWARF
129         addr:            0x00000000000000DB
130         size:            18
131         offset:          0x000002EB
132         align:           0
133         reloff:          0x00000000
134         nreloc:          0
135         flags:           0x00000000
136         reserved1:       0x00000000
137         reserved2:       0x00000000
138         reserved3:       0x00000000
139   - cmd:             LC_SYMTAB
140     cmdsize:         24
141     symoff:          0
142     nsyms:           0
143     stroff:          792
144     strsize:         8
145   - cmd:             LC_BUILD_VERSION
146     cmdsize:         32
147     platform:        1
148     minos:           658944
149     sdk:             658944
150     ntools:          1
151     Tools:
152       - tool:            3
153         version:         34734080
154   - cmd:             LC_DATA_IN_CODE
155     cmdsize:         16
156     dataoff:         792
157     datasize:        0
158 LinkEditData:
159   StringTable:
160     - ' '
161     - ''
162     - ''
163     - ''
164     - ''
165     - ''
166     - ''
167 DWARF:
168   debug_str:
169     - ''
170     - '/tmp/main.c'
171     - main
172   debug_abbrev:
173     - Table:
174         - Code:            0x00000001
175           Tag:             DW_TAG_compile_unit
176           Children:        DW_CHILDREN_yes
177           Attributes:
178             - Attribute:       DW_AT_name
179               Form:            DW_FORM_strp
180             - Attribute:       DW_AT_language
181               Form:            DW_FORM_data2
182             - Attribute:       DW_AT_low_pc
183               Form:            DW_FORM_addr
184             - Attribute:       DW_AT_ranges
185               Form:            DW_FORM_sec_offset
186         - Code:            0x00000002
187           Tag:             DW_TAG_subprogram
188           Children:        DW_CHILDREN_yes
189           Attributes:
190             - Attribute:       DW_AT_name
191               Form:            DW_FORM_strp
192             - Attribute:       DW_AT_low_pc
193               Form:            DW_FORM_addr
194             - Attribute:       DW_AT_high_pc
195               Form:            DW_FORM_addr
196         - Code:            0x00000003
197           Tag:             DW_TAG_lexical_block
198           Children:        DW_CHILDREN_no
199           Attributes:
200             - Attribute:       DW_AT_low_pc
201               Form:            DW_FORM_addr
202             - Attribute:       DW_AT_high_pc
203               Form:            DW_FORM_addr
205   debug_ranges:
206     - Offset:          0x00000000
207       AddrSize:        0x08
208       Entries:
209         - LowOffset:       0x0000000000001000
210           HighOffset:      0x0000000000002000
211   debug_info:
212     - Version:         4
213       AddrSize:        8
214       Entries:
215         - AbbrCode:        0x00000001
216           Values:
217             - Value:           0x0000000000000001
218             - Value:           0x0000000000000002
219             - Value:           0x0000000000000000
220             - Value:           0x0000000000000000
221         - AbbrCode:        0x00000002
222           Values:
223             - Value:           0x000000000000000D
224             - Value:           0x0000000000000000
225             - Value:           0x0000000000000000
226         - AbbrCode:        0x00000003
227           Values:
228             - Value:           0x0000000000001000
229             - Value:           0x0000000000002000
230         - AbbrCode:        0x00000003
231           Values:
232             - Value:           0x0000000000001000
233             - Value:           0x0000000000002000
234         - AbbrCode:        0x00000000
235         - AbbrCode:        0x00000000