File: bb-addr-map.yaml

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (133 lines) | stat: -rw-r--r-- 3,975 bytes parent folder | download | duplicates (6)
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
## Check how yaml2obj produces .llvm_bb_addr_map sections.

# RUN: yaml2obj --docnum=1 %s -o %t1
# RUN: llvm-readobj --sections --section-data %t1 | FileCheck %s

## Case 1: Specify content.
# CHECK:      Section {
# CHECK:        Index: 1
# CHECK-NEXT:   Name: .llvm_bb_addr_map (1)
# CHECK-NEXT:   Type: SHT_LLVM_BB_ADDR_MAP (0x6FFF4C08)
# CHECK-NEXT:   Flags [ (0x0)
# CHECK-NEXT:   ]
# CHECK-NEXT:   Address: 0x0
# CHECK-NEXT:   Offset: 0x40
# CHECK-NEXT:   Size: 12
# CHECK-NEXT:   Link: 0
# CHECK-NEXT:   Info: 0
# CHECK-NEXT:   AddressAlignment: 0
# CHECK-NEXT:   EntrySize: 0
# CHECK-NEXT:   SectionData (
# CHECK-NEXT:     0000: 00000000 00000000 01010203
# CHECK-NEXT:   )
# CHECK-NEXT: }

## Case 2: Empty.
# CHECK:        Name: .llvm_bb_addr_map (1)
# CHECK:        Size:
# CHECK-SAME:   {{^ 0$}}

## Case 3: Specify Size only.
# CHECK:        Name: .llvm_bb_addr_map (1)
# CHECK:        SectionData (
# CHECK-NEXT:     0000: 00000000 00000000
# CHECK-NEXT:   )

# Case 4: Specify Entries.
# CHECK:        Name: .llvm_bb_addr_map (1)
# CHECK:        SectionData (
# CHECK-NEXT:     0000: 20000000 00000000 01010203
# CHECK-NEXT:   )

# Case 5: Specify Entries and omit the Address field.
# CHECK:        Name: .llvm_bb_addr_map (1)
# CHECK:        Address:
# CHECK-SAME:   {{^ 0x0$}}
# CHECK:        SectionData (
# CHECK-NEXT:     0000: 00000000 00000000 01010203
# CHECK-NEXT:   )

# Case 6: Override the NumBlocks field.
# CHECK:        Name: .llvm_bb_addr_map (1)
# CHECK:        SectionData (
# CHECK-NEXT:     0000: 20000000 00000000 02010203
# CHECK-NEXT:   )

--- !ELF
FileHeader:
  Class: ELFCLASS64
  Data:  ELFDATA2LSB
  Type:  ET_EXEC
Sections:

## Test the following cases:

## 1) We can produce an .llvm_bb_addr_map section from a description with section
##    content.
##  Specify Content.
  - Name:    '.llvm_bb_addr_map (1)'
    Type:    SHT_LLVM_BB_ADDR_MAP
    Content: "000000000000000001010203"

## 2) We can produce an empty .llvm_bb_addr_map section from a description
##    with empty section content.
  - Name:    '.llvm_bb_addr_map (2)'
    Type:    SHT_LLVM_BB_ADDR_MAP

## 3) We can produce a zero .llvm_bb_addr_map section of a specific size when
##    we specify the size only.
  - Name:    '.llvm_bb_addr_map (3)'
    Type:    SHT_LLVM_BB_ADDR_MAP
    Size:    8

## 4) We can produce an .llvm_bb_addr_map section from a description with
##    Entries.
  - Name:    '.llvm_bb_addr_map (4)'
    Type:    SHT_LLVM_BB_ADDR_MAP
    Entries:
      - Address:   0x0000000000000020
        BBEntries:
          - AddressOffset:    0x00000001
            Size:             0x00000002
            Metadata:         0x00000003

## 5) When specifying the description with Entries, the 'Address' field will be
##    zero when omitted.
  - Name:    '.llvm_bb_addr_map (5)'
    Type:    SHT_LLVM_BB_ADDR_MAP
    Entries:
      - BBEntries:
          - AddressOffset:    0x00000001
            Size:             0x00000002
            Metadata:         0x00000003

## 6) We can override the NumBlocks field with a value different from the
##    actual number of BB Entries.
  - Name:    '.llvm_bb_addr_map (6)'
    Type:    SHT_LLVM_BB_ADDR_MAP
    Entries:
      - Address:   0x0000000000000020
        NumBlocks: 2
        BBEntries:
          - AddressOffset:    0x00000001
            Size:             0x00000002
            Metadata:         0x00000003

## Check we can't use Entries at the same time as either Content or Size.
# RUN: not yaml2obj --docnum=2 -DCONTENT="00" %s 2>&1 | FileCheck %s --check-prefix=INVALID
# RUN: not yaml2obj --docnum=2 -DSIZE="0" %s 2>&1 | FileCheck %s --check-prefix=INVALID

# INVALID: error: "Entries" cannot be used with "Content" or "Size"

--- !ELF
FileHeader:
  Class: ELFCLASS64
  Data:  ELFDATA2LSB
  Type:  ET_EXEC
Sections:
##  Specify Content and Size
  - Name:    '.llvm_bb_addr_map'
    Type:    SHT_LLVM_BB_ADDR_MAP
    Entries: []
    Content: [[CONTENT=<none>]]
    Size:    [[SIZE=<none>]]