File: bb-addr-map.yaml

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (258 lines) | stat: -rw-r--r-- 7,928 bytes parent folder | download | duplicates (5)
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
258
## Check how obj2yaml produces YAML .llvm_bb_addr_map descriptions.

## Fails on windows (https://github.com/llvm/llvm-project/issues/60013).
# UNSUPPORTED: system-windows

## Check that obj2yaml uses the "Entries" tag to describe an .llvm_bb_addr_map section.

# RUN: yaml2obj --docnum=1 %s -o %t1
# RUN: obj2yaml %t1 | FileCheck %s --check-prefix=VALID

# VALID:      --- !ELF
# VALID-NEXT: FileHeader:
# VALID-NEXT:   Class: ELFCLASS64
# VALID-NEXT:   Data:  ELFDATA2LSB
# VALID-NEXT:   Type:  ET_EXEC
# VALID-NEXT: Sections:
# VALID-NEXT:   - Name: .llvm_bb_addr_map
# VALID-NEXT:     Type: SHT_LLVM_BB_ADDR_MAP
# VALID-NEXT:     Entries:
## The 'Address' field is omitted when it's zero.
# VALID-NEXT:       - Version: 2
# VALID-NEXT:         Feature: 0xFF
# VALID-NEXT:         BBEntries:
# VALID-NEXT:           - ID:            0
# VALID-NEXT:             AddressOffset: 0x1
# VALID-NEXT:             Size:          0x2
# VALID-NEXT:             Metadata:      0x3
# VALID-NEXT:           - ID:            2
# VALID-NEXT:             AddressOffset: 0x4
# VALID-NEXT:             Size:          0x5
# VALID-NEXT:             Metadata:      0x6
# VALID-NEXT:           - ID:            4
# VALID-NEXT:             AddressOffset: 0xFFFFFFFFFFFFFFF7
# VALID-NEXT:             Size:          0xFFFFFFFFFFFFFFF8
# VALID-NEXT:             Metadata:      0xFFFFFFFFFFFFFFF9
# VALID-NEXT:       - Version: 2
# VALID-NEXT:         Feature: 0xEE
# VALID-NEXT:         Address: 0xFFFFFFFFFFFFFF20
# VALID-NEXT:         BBEntries:
# VALID-NEXT:           - ID:            6
# VALID-NEXT:             AddressOffset: 0xA
# VALID-NEXT:             Size:          0xB
# VALID-NEXT:             Metadata:      0xC

--- !ELF
FileHeader:
  Class: ELFCLASS64
  Data:  ELFDATA2LSB
  Type:  ET_EXEC
Sections:
  - Name:   .llvm_bb_addr_map
    Type:   SHT_LLVM_BB_ADDR_MAP
    ShSize: [[SIZE=<none>]]
    Entries:
      - Version: 2
        Feature: 0xFF
        Address: 0x0
        BBEntries:
          - ID:            0
            AddressOffset: 0x1
            Size:          0x2
            Metadata:      0x3
          - ID:            2
            AddressOffset: 0x4
            Size:          0x5
            Metadata:      0x6
          - ID:            4
            AddressOffset: 0xFFFFFFFFFFFFFFF7
            Size:          0xFFFFFFFFFFFFFFF8
            Metadata:      0xFFFFFFFFFFFFFFF9
      - Version:   2
        Feature:   0xEE
        Address:   0xFFFFFFFFFFFFFF20
        NumBlocks: [[NUMBLOCKS=<none>]]
        BBEntries:
          - ID:            6
            AddressOffset: 0xA
            Size:          0xB
            Metadata:      0xC

## Check obj2yaml can dump empty .llvm_bb_addr_map sections.

# RUN: yaml2obj --docnum=2 %s -o %t2
# RUN: obj2yaml %t2 | FileCheck %s --check-prefix=EMPTY

# EMPTY:      --- !ELF
# EMPTY-NEXT: FileHeader:
# EMPTY-NEXT:   Class: ELFCLASS64
# EMPTY-NEXT:   Data:  ELFDATA2LSB
# EMPTY-NEXT:   Type:  ET_EXEC
# EMPTY-NEXT: Sections:
# EMPTY-NEXT:   - Name:    .llvm_bb_addr_map
# EMPTY-NEXT:     Type:    SHT_LLVM_BB_ADDR_MAP
# EMPTY-NOT:      Content:

--- !ELF
FileHeader:
  Class: ELFCLASS64
  Data:  ELFDATA2LSB
  Type:  ET_EXEC
Sections:
  - Name:    .llvm_bb_addr_map
    Type:    SHT_LLVM_BB_ADDR_MAP
    Content: ""

## Check obj2yaml can dump multiple .llvm_bb_addr_map sections.

# RUN: yaml2obj --docnum=3 %s -o %t3
# RUN: obj2yaml %t3 | FileCheck %s --check-prefix=MULTI

# MULTI:      --- !ELF
# MULTI-NEXT: FileHeader:
# MULTI-NEXT:   Class: ELFCLASS64
# MULTI-NEXT:   Data:  ELFDATA2LSB
# MULTI-NEXT:   Type:  ET_EXEC
# MULTI-NEXT: Sections:
# MULTI-NEXT:   - Name: .llvm_bb_addr_map
# MULTI-NEXT:     Type: SHT_LLVM_BB_ADDR_MAP
# MULTI-NEXT:     Entries:
## Fields 'Address' and 'Feature' are omitted when they are zero.
# MULTI-NEXT:       - Version: 0
# MULTI-NEXT:         BBEntries:
# MULTI-NEXT:           - ID:            0
# MULTI-NEXT:             AddressOffset: 0x1
# MULTI-NEXT:             Size:          0x2
# MULTI-NEXT:             Metadata:      0x3
# MULTI-NEXT:   - Name: '.llvm_bb_addr_map (1)'
# MULTI-NEXT:     Type: SHT_LLVM_BB_ADDR_MAP
# MULTI-NEXT:     Entries:
# MULTI-NEXT:       - Version:   0
# MULTI-NEXT:         Address:   0x20
# MULTI-NEXT:         BBEntries: []

--- !ELF
FileHeader:
  Class: ELFCLASS64
  Data:  ELFDATA2LSB
  Type:  ET_EXEC
Sections:
  - Name: .llvm_bb_addr_map
    Type: SHT_LLVM_BB_ADDR_MAP
    Entries:
## Check that obj2yaml does not emit the 'Address' and 'Feature' fields when
## they are zero.
      - Version: 0
        Feature: 0x0
        Address: 0x0
        BBEntries:
          - AddressOffset: 0x1
            Size:          0x2
            Metadata:      0x3
  - Name: '.llvm_bb_addr_map (1)'
    Type:  SHT_LLVM_BB_ADDR_MAP
    Entries:
      - Version: 0
        Address: 0x20

## Check that obj2yaml uses the "Content" tag to describe an .llvm_bb_addr_map section
## when it can't extract the entries, for example, when the section is truncated, or
## when an invalid 'NumBlocks' field is specified.

# RUN: yaml2obj --docnum=1 -DSIZE=0x8 %s -o %t4
# RUN: obj2yaml %t4 | FileCheck %s --check-prefixes=TRUNCATED,INVALID

# RUN: yaml2obj --docnum=1 -DNUMBLOCKS=2 %s -o %t5
# RUN: obj2yaml %t5 | FileCheck %s --check-prefixes=BADNUMBLOCKS,INVALID

# INVALID:           --- !ELF
# INVALID-NEXT:      FileHeader:
# INVALID-NEXT:        Class: ELFCLASS64
# INVALID-NEXT:        Data:  ELFDATA2LSB
# INVALID-NEXT:        Type:  ET_EXEC
# INVALID-NEXT:      Sections:
# INVALID-NEXT:        - Name:    .llvm_bb_addr_map
# INVALID-NEXT:          Type:    SHT_LLVM_BB_ADDR_MAP
# BADNUMBLOCKS-NEXT:     Content: {{([[:xdigit:]]+)}}{{$}}
# TRUNCATED-NEXT:        Content: {{([[:xdigit:]]{16})}}{{$}}

## Check obj2yaml for SHT_LLVM_BB_ADDR_MAP_V0.
# RUN: yaml2obj --docnum=4 %s -o %t6
# RUN: obj2yaml %t6 | FileCheck %s --check-prefix=V0

# V0:      --- !ELF
# V0-NEXT: FileHeader:
# V0-NEXT:   Class: ELFCLASS64
# V0-NEXT:   Data:  ELFDATA2LSB
# V0-NEXT:   Type:  ET_EXEC
# V0-NEXT: Sections:
# V0-NEXT:   - Name: .llvm_bb_addr_map
# V0-NEXT:     Type: SHT_LLVM_BB_ADDR_MAP_V0
# V0-NEXT:     Entries:
# V0-NEXT:       - Version: 0
# V0-NEXT:         Address: 0x1111
# V0-NEXT:         BBEntries:
# V0-NEXT:           - ID:            0
# V0-NEXT:             AddressOffset: 0x1
# V0-NEXT:             Size:          0x2
# V0-NEXT:             Metadata:      0x3

--- !ELF
FileHeader:
  Class: ELFCLASS64
  Data:  ELFDATA2LSB
  Type:  ET_EXEC
Sections:
  - Name: .llvm_bb_addr_map
    Type: SHT_LLVM_BB_ADDR_MAP_V0
    Entries:
      - Version: 0
        Address: 0x1111
        BBEntries:
          - AddressOffset: 0x1
            Size:          0x2
            Metadata:      0x3

## Check obj2yaml for version 1.
# RUN: yaml2obj --docnum=5 %s -o %t7
# RUN: obj2yaml %t7 | FileCheck %s --check-prefix=V1

# V1:      --- !ELF
# V1-NEXT: FileHeader:
# V1-NEXT:   Class: ELFCLASS64
# V1-NEXT:   Data:  ELFDATA2LSB
# V1-NEXT:   Type:  ET_EXEC
# V1-NEXT: Sections:
# V1-NEXT:   - Name: .llvm_bb_addr_map
# V1-NEXT:     Type: SHT_LLVM_BB_ADDR_MAP
# V1-NEXT:     Entries:
# V1-NEXT:       - Version: 1
# V1-NEXT:         Address: 0x1111
# V1-NEXT:         BBEntries:
# V1-NEXT:           - ID:            0
# V1-NEXT:             AddressOffset: 0x1
# V1-NEXT:             Size:          0x2
# V1-NEXT:             Metadata:      0x3
# V1-NEXT:           - ID:            1
# V1-NEXT:             AddressOffset: 0x4
# V1-NEXT:             Size:          0x5
# V1-NEXT:             Metadata:      0x6

--- !ELF
FileHeader:
  Class: ELFCLASS64
  Data:  ELFDATA2LSB
  Type:  ET_EXEC
Sections:
  - Name: .llvm_bb_addr_map
    Type: SHT_LLVM_BB_ADDR_MAP
    Entries:
      - Version: 1
        Address: 0x1111
        BBEntries:
          - AddressOffset: 0x1
            Size:          0x2
            Metadata:      0x3
          - AddressOffset: 0x4
            Size:          0x5
            Metadata:      0x6