Follow up to d0858bffa11, add missing REQUIRES x86
[llvm-project.git] / llvm / test / tools / llvm-dwarfutil / ELF / X86 / gc-func-overlapping-address-ranges.test
blob46ebcf24fe64dc087f584f4bf68bf38b252d2b5d
1 ## This test checks that overlapping function address ranges
2 ## are combined during --garbage-collection optimisation.
4 # RUN: yaml2obj %s -o %t.o
5 # RUN: llvm-dwarfutil --no-odr --garbage-collection %t.o %t1
6 # RUN: llvm-dwarfdump -a %t1 | FileCheck %s
8 # RUN: llvm-dwarfutil --no-odr --linker llvm --garbage-collection %t.o %t1
9 # RUN: llvm-dwarfdump -a %t1 | FileCheck %s
11 # CHECK: DW_TAG_compile_unit
12 # CHECK: DW_AT_name{{.*}}"CU1"
13 # CHECK: DW_AT_low_pc{{.*}}0000000000001000
14 # CHECK: DW_AT_ranges
15 # CHECK: [0x0000000000001000, 0x000000000000102d)
16 # CHECK: [0x0000000000002002, 0x000000000000200d)
17 # CHECK: [0x000000000000201b, 0x000000000000202a)
18 # CHECK: [0x0000000000003002, 0x0000000000003007)
19 # CHECK: [0x0000000000003012, 0x0000000000003017)
20 # CHECK: [0x0000000000003018, 0x000000000000301a)
21 # CHECK: [0x0000000000003022, 0x0000000000003027
22 # CHECK: DW_TAG_class_type
23 # CHECK: DW_AT_name{{.*}}"class1"
24 # CHECK: DW_TAG_class_type
25 # CHECK: "class2"
26 # CHECK: DW_TAG_subprogram
27 # CHECK: DW_AT_name{{.*}}"foo1"
28 # CHECK: DW_AT_low_pc{{.*}}0x0000000000001000
29 # CHECK: DW_AT_high_pc{{.*}}0x0000000000001010
30 # CHECK: DW_AT_type{{.*}}"class1"
31 # CHECK: DW_TAG_subprogram
32 # CHECK: "foo2"
33 # CHECK: DW_AT_low_pc{{.*}}0x0000000000001004
34 # CHECK: DW_AT_high_pc{{.*}}0x0000000000001007
35 # CHECK: DW_AT_type{{.*}}"class2"
36 # CHECK: DW_TAG_subprogram
37 # CHECK: "foo3"
38 # CHECK: DW_AT_low_pc{{.*}}0x000000000000100d
39 # CHECK: DW_AT_high_pc{{.*}}0x000000000000102d
40 # CHECK: DW_TAG_subprogram
41 # CHECK: "foo4"
42 # CHECK: DW_AT_low_pc{{.*}}0x0000000000002002
43 # CHECK: DW_AT_high_pc{{.*}}0x000000000000200d
44 # CHECK: DW_TAG_subprogram
45 # CHECK: "foo5"
46 # CHECK: DW_AT_low_pc{{.*}}0x000000000000201b
47 # CHECK: DW_AT_high_pc{{.*}}0x000000000000202a
48 # CHECK: DW_TAG_subprogram
49 # CHECK: "foo6"
50 # CHECK: DW_AT_low_pc{{.*}}0x0000000000003002
51 # CHECK: DW_AT_high_pc{{.*}}0x0000000000003007
52 # CHECK: DW_TAG_subprogram
53 # CHECK: "foo7"
54 # CHECK: DW_AT_low_pc{{.*}}0x0000000000003012
55 # CHECK: DW_AT_high_pc{{.*}}0x0000000000003017
56 # CHECK: DW_TAG_subprogram
57 # CHECK: "foo8"
58 # CHECK: DW_AT_low_pc{{.*}}0x0000000000003022
59 # CHECK: DW_AT_high_pc{{.*}}0x0000000000003027
60 # CHECK: DW_TAG_subprogram
61 # CHECK: "foo9"
62 # CHECK: DW_AT_low_pc{{.*}}0x0000000000003012
63 # CHECK: DW_AT_high_pc{{.*}}0x0000000000003017
64 # CHECK: "foo10"
65 # CHECK: DW_AT_low_pc{{.*}}0x0000000000003018
66 # CHECK: DW_AT_high_pc{{.*}}0x000000000000301a
68 --- !ELF
69 FileHeader:
70   Class:    ELFCLASS64
71   Data:     ELFDATA2LSB
72   Type:     ET_REL
73   Machine:  EM_X86_64
74 Sections:
75   - Name:            .text
76     Type:            SHT_PROGBITS
77     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
78     Address:         0x1000
79     AddressAlign:    0x0000000000000010
80     Content:        "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
81   - Name:            .text2
82     Type:            SHT_PROGBITS
83     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
84     Address:         0x2000
85     AddressAlign:    0x0000000000000010
86     Content:        "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
87   - Name:            .text3
88     Type:            SHT_PROGBITS
89     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
90     Address:         0x3000
91     AddressAlign:    0x0000000000000010
92     Content:        "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
93 DWARF:
94   debug_abbrev:
95     - Table:
96       - Tag:      DW_TAG_compile_unit
97         Children: DW_CHILDREN_yes
98         Attributes:
99           - Attribute: DW_AT_producer
100             Form:      DW_FORM_string
101           - Attribute: DW_AT_language
102             Form:      DW_FORM_data2
103           - Attribute: DW_AT_name
104             Form:      DW_FORM_string
105           - Attribute: DW_AT_low_pc
106             Form:      DW_FORM_addr
107           - Attribute: DW_AT_ranges
108             Form:      DW_FORM_sec_offset
109       - Tag:      DW_TAG_subprogram
110         Children: DW_CHILDREN_no
111         Attributes:
112           - Attribute: DW_AT_name
113             Form:      DW_FORM_string
114           - Attribute: DW_AT_low_pc
115             Form:      DW_FORM_addr
116           - Attribute: DW_AT_high_pc
117             Form:      DW_FORM_data8
118           - Attribute: DW_AT_type
119             Form:      DW_FORM_ref4
120       - Tag:      DW_TAG_class_type
121         Children: DW_CHILDREN_yes
122         Attributes:
123           - Attribute: DW_AT_name
124             Form:      DW_FORM_string
125       - Tag:      DW_TAG_member
126         Children: DW_CHILDREN_no
127         Attributes:
128           - Attribute: DW_AT_type
129             Form:      DW_FORM_ref4
130           - Attribute: DW_AT_name
131             Form:      DW_FORM_string
132       - Tag:      DW_TAG_class_type
133         Children: DW_CHILDREN_no
134         Attributes:
135           - Attribute: DW_AT_name
136             Form:      DW_FORM_string
137           - Attribute: DW_AT_declaration
138             Form:      DW_FORM_flag_present
139       - Tag:      DW_TAG_class_type
140         Children: DW_CHILDREN_yes
141         Attributes:
142           - Attribute: DW_AT_name
143             Form:      DW_FORM_string
144           - Attribute: DW_AT_declaration
145             Form:      DW_FORM_flag_present
146       - Tag:      DW_TAG_template_type_parameter
147         Children: DW_CHILDREN_no
148         Attributes:
149           - Attribute: DW_AT_type
150             Form:      DW_FORM_ref4
151       - Tag:      DW_TAG_base_type
152         Children: DW_CHILDREN_no
153         Attributes:
154           - Attribute: DW_AT_name
155             Form:      DW_FORM_string
156   debug_info:
157     - Version: 4
158       Entries:
159         - AbbrCode: 1
160           Values:
161             - CStr: by_hand
162             - Value:  0x04
163             - CStr: CU1
164             - Value:  0x00
165             - Value:  0x00
166         - AbbrCode: 3
167           Values:
168             - CStr: class1
169         - AbbrCode: 4
170           Values:
171             - Value:  0x00000052
172             - CStr: member1
173         - AbbrCode: 0
174         - AbbrCode: 3
175           Values:
176             - CStr: class2
177         - AbbrCode: 4
178           Values:
179             - Value:  0x00000052
180             - CStr: member1
181         - AbbrCode: 0
182         - AbbrCode: 8
183           Values:
184             - CStr: int
185         - AbbrCode: 2
186           Values:
187             - CStr: foo1
188             - Value:  0x1000
189             - Value:  0x10
190             - Value:  0x00000026
191         - AbbrCode: 2
192           Values:
193             - CStr: foo2
194             - Value:  0x1004
195             - Value:  0x3
196             - Value:  0x0000003c
197         - AbbrCode: 2
198           Values:
199             - CStr: foo3
200             - Value:  0x100d
201             - Value:  0x20
202             - Value:  0x0000003c
203         - AbbrCode: 2
204           Values:
205             - CStr: foo4
206             - Value:  0x2002
207             - Value:  0xb
208             - Value:  0x0000003c
209         - AbbrCode: 2
210           Values:
211             - CStr: foo5
212             - Value:  0x201b
213             - Value:  0xf
214             - Value:  0x0000003c
215         - AbbrCode: 2
216           Values:
217             - CStr: foo6
218             - Value:  0x3002
219             - Value:  0x5
220             - Value:  0x0000003c
221         - AbbrCode: 2
222           Values:
223             - CStr: foo7
224             - Value:  0x3012
225             - Value:  0x5
226             - Value:  0x0000003c
227         - AbbrCode: 2
228           Values:
229             - CStr: foo8
230             - Value:  0x3022
231             - Value:  0x5
232             - Value:  0x0000003c
233         - AbbrCode: 2
234           Values:
235             - CStr: foo9
236             - Value:  0x3012
237             - Value:  0x5
238             - Value:  0x0000003c
239         - AbbrCode: 2
240           Values:
241             - CStr: foo10
242             - Value:  0x3018
243             - Value:  0x2
244             - Value:  0x0000003c
245         - AbbrCode: 0
247   debug_ranges:
248     - Offset:          0x00000000
249       AddrSize:        0x08
250       Entries:
251         - LowOffset:       0x0000000000001000
252           HighOffset:      0x000000000000102d
253         - LowOffset:       0x0000000000002000
254           HighOffset:      0x000000000000202d
255         - LowOffset:       0x0000000000000000
256           HighOffset:      0x0000000000000000