aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/tools/llvm-dwarfutil/ELF/X86/gc-func-overlapping-address-ranges.test
blob: 117f527671c9d1b010942e6f8589b99ce64ba419 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
## This test checks that overlapping function address ranges
## are combined during --garbage-collection optimisation.

# RUN: yaml2obj %s -o %t.o
# RUN: llvm-dwarfutil --no-odr --garbage-collection %t.o %t1
# RUN: llvm-dwarfdump -a %t1 | FileCheck %s

# RUN: llvm-dwarfutil --no-odr --linker parallel --garbage-collection %t.o %t1
# RUN: llvm-dwarfdump -a %t1 | FileCheck %s

# CHECK: DW_TAG_compile_unit
# CHECK: DW_AT_name{{.*}}"CU1"
# CHECK: DW_AT_low_pc{{.*}}0000000000001000
# CHECK: DW_AT_ranges
# CHECK: [0x0000000000001000, 0x000000000000102d)
# CHECK: [0x0000000000002002, 0x000000000000200d)
# CHECK: [0x000000000000201b, 0x000000000000202a)
# CHECK: [0x0000000000003002, 0x0000000000003007)
# CHECK: [0x0000000000003012, 0x0000000000003017)
# CHECK: [0x0000000000003018, 0x000000000000301a)
# CHECK: [0x0000000000003022, 0x0000000000003027
# CHECK: DW_TAG_class_type
# CHECK: DW_AT_name{{.*}}"class1"
# CHECK: DW_TAG_class_type
# CHECK: "class2"
# CHECK: DW_TAG_subprogram
# CHECK: DW_AT_name{{.*}}"foo1"
# CHECK: DW_AT_low_pc{{.*}}0x0000000000001000
# CHECK: DW_AT_high_pc{{.*}}0x0000000000001010
# CHECK: DW_AT_type{{.*}}"class1"
# CHECK: DW_TAG_subprogram
# CHECK: "foo2"
# CHECK: DW_AT_low_pc{{.*}}0x0000000000001004
# CHECK: DW_AT_high_pc{{.*}}0x0000000000001007
# CHECK: DW_AT_type{{.*}}"class2"
# CHECK: DW_TAG_subprogram
# CHECK: "foo3"
# CHECK: DW_AT_low_pc{{.*}}0x000000000000100d
# CHECK: DW_AT_high_pc{{.*}}0x000000000000102d
# CHECK: DW_TAG_subprogram
# CHECK: "foo4"
# CHECK: DW_AT_low_pc{{.*}}0x0000000000002002
# CHECK: DW_AT_high_pc{{.*}}0x000000000000200d
# CHECK: DW_TAG_subprogram
# CHECK: "foo5"
# CHECK: DW_AT_low_pc{{.*}}0x000000000000201b
# CHECK: DW_AT_high_pc{{.*}}0x000000000000202a
# CHECK: DW_TAG_subprogram
# CHECK: "foo6"
# CHECK: DW_AT_low_pc{{.*}}0x0000000000003002
# CHECK: DW_AT_high_pc{{.*}}0x0000000000003007
# CHECK: DW_TAG_subprogram
# CHECK: "foo7"
# CHECK: DW_AT_low_pc{{.*}}0x0000000000003012
# CHECK: DW_AT_high_pc{{.*}}0x0000000000003017
# CHECK: DW_TAG_subprogram
# CHECK: "foo8"
# CHECK: DW_AT_low_pc{{.*}}0x0000000000003022
# CHECK: DW_AT_high_pc{{.*}}0x0000000000003027
# CHECK: DW_TAG_subprogram
# CHECK: "foo9"
# CHECK: DW_AT_low_pc{{.*}}0x0000000000003012
# CHECK: DW_AT_high_pc{{.*}}0x0000000000003017
# CHECK: "foo10"
# CHECK: DW_AT_low_pc{{.*}}0x0000000000003018
# CHECK: DW_AT_high_pc{{.*}}0x000000000000301a

--- !ELF
FileHeader:
  Class:    ELFCLASS64
  Data:     ELFDATA2LSB
  Type:     ET_REL
  Machine:  EM_X86_64
Sections:
  - Name:            .text
    Type:            SHT_PROGBITS
    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
    Address:         0x1000
    AddressAlign:    0x0000000000000010
    Content:        "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  - Name:            .text2
    Type:            SHT_PROGBITS
    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
    Address:         0x2000
    AddressAlign:    0x0000000000000010
    Content:        "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  - Name:            .text3
    Type:            SHT_PROGBITS
    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
    Address:         0x3000
    AddressAlign:    0x0000000000000010
    Content:        "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
DWARF:
  debug_abbrev:
    - Table:
      - Tag:      DW_TAG_compile_unit
        Children: DW_CHILDREN_yes
        Attributes:
          - Attribute: DW_AT_producer
            Form:      DW_FORM_string
          - Attribute: DW_AT_language
            Form:      DW_FORM_data2
          - Attribute: DW_AT_name
            Form:      DW_FORM_string
          - Attribute: DW_AT_low_pc
            Form:      DW_FORM_addr
          - Attribute: DW_AT_ranges
            Form:      DW_FORM_sec_offset
      - Tag:      DW_TAG_subprogram
        Children: DW_CHILDREN_no
        Attributes:
          - Attribute: DW_AT_name
            Form:      DW_FORM_string
          - Attribute: DW_AT_low_pc
            Form:      DW_FORM_addr
          - Attribute: DW_AT_high_pc
            Form:      DW_FORM_data8
          - Attribute: DW_AT_type
            Form:      DW_FORM_ref4
      - Tag:      DW_TAG_class_type
        Children: DW_CHILDREN_yes
        Attributes:
          - Attribute: DW_AT_name
            Form:      DW_FORM_string
      - Tag:      DW_TAG_member
        Children: DW_CHILDREN_no
        Attributes:
          - Attribute: DW_AT_type
            Form:      DW_FORM_ref4
          - Attribute: DW_AT_name
            Form:      DW_FORM_string
      - Tag:      DW_TAG_class_type
        Children: DW_CHILDREN_no
        Attributes:
          - Attribute: DW_AT_name
            Form:      DW_FORM_string
          - Attribute: DW_AT_declaration
            Form:      DW_FORM_flag_present
      - Tag:      DW_TAG_class_type
        Children: DW_CHILDREN_yes
        Attributes:
          - Attribute: DW_AT_name
            Form:      DW_FORM_string
          - Attribute: DW_AT_declaration
            Form:      DW_FORM_flag_present
      - Tag:      DW_TAG_template_type_parameter
        Children: DW_CHILDREN_no
        Attributes:
          - Attribute: DW_AT_type
            Form:      DW_FORM_ref4
      - Tag:      DW_TAG_base_type
        Children: DW_CHILDREN_no
        Attributes:
          - Attribute: DW_AT_name
            Form:      DW_FORM_string
  debug_info:
    - Version: 4
      Entries:
        - AbbrCode: 1
          Values:
            - CStr: by_hand
            - Value:  0x04
            - CStr: CU1
            - Value:  0x00
            - Value:  0x00
        - AbbrCode: 3
          Values:
            - CStr: class1
        - AbbrCode: 4
          Values:
            - Value:  0x00000052
            - CStr: member1
        - AbbrCode: 0
        - AbbrCode: 3
          Values:
            - CStr: class2
        - AbbrCode: 4
          Values:
            - Value:  0x00000052
            - CStr: member1
        - AbbrCode: 0
        - AbbrCode: 8
          Values:
            - CStr: int
        - AbbrCode: 2
          Values:
            - CStr: foo1
            - Value:  0x1000
            - Value:  0x10
            - Value:  0x00000026
        - AbbrCode: 2
          Values:
            - CStr: foo2
            - Value:  0x1004
            - Value:  0x3
            - Value:  0x0000003c
        - AbbrCode: 2
          Values:
            - CStr: foo3
            - Value:  0x100d
            - Value:  0x20
            - Value:  0x0000003c
        - AbbrCode: 2
          Values:
            - CStr: foo4
            - Value:  0x2002
            - Value:  0xb
            - Value:  0x0000003c
        - AbbrCode: 2
          Values:
            - CStr: foo5
            - Value:  0x201b
            - Value:  0xf
            - Value:  0x0000003c
        - AbbrCode: 2
          Values:
            - CStr: foo6
            - Value:  0x3002
            - Value:  0x5
            - Value:  0x0000003c
        - AbbrCode: 2
          Values:
            - CStr: foo7
            - Value:  0x3012
            - Value:  0x5
            - Value:  0x0000003c
        - AbbrCode: 2
          Values:
            - CStr: foo8
            - Value:  0x3022
            - Value:  0x5
            - Value:  0x0000003c
        - AbbrCode: 2
          Values:
            - CStr: foo9
            - Value:  0x3012
            - Value:  0x5
            - Value:  0x0000003c
        - AbbrCode: 2
          Values:
            - CStr: foo10
            - Value:  0x3018
            - Value:  0x2
            - Value:  0x0000003c
        - AbbrCode: 0

  debug_ranges:
    - Offset:          0x00000000
      AddrSize:        0x08
      Entries:
        - LowOffset:       0x0000000000001000
          HighOffset:      0x000000000000102d
        - LowOffset:       0x0000000000002000
          HighOffset:      0x000000000000202d
        - LowOffset:       0x0000000000000000
          HighOffset:      0x0000000000000000
...