1 ## Check how yaml2obj produces .llvm_bb_addr_map sections.
3 # RUN: yaml2obj --docnum=1 %s -o %t1
4 # RUN: llvm-readobj --sections --section-data %t1 | FileCheck %s
6 ## Case 1: Specify content.
9 # CHECK-NEXT: Name: .llvm_bb_addr_map (1)
10 # CHECK-NEXT: Type: SHT_LLVM_BB_ADDR_MAP (0x6FFF4C08)
11 # CHECK-NEXT: Flags [ (0x0)
13 # CHECK-NEXT: Address: 0x0
14 # CHECK-NEXT: Offset: 0x40
15 # CHECK-NEXT: Size: 12
18 # CHECK-NEXT: AddressAlignment: 0
19 # CHECK-NEXT: EntrySize: 0
20 # CHECK-NEXT: SectionData (
21 # CHECK-NEXT: 0000: 00000000 00000000 01010203
26 # CHECK: Name: .llvm_bb_addr_map (1)
28 # CHECK-SAME: {{^ 0$}}
30 ## Case 3: Specify Size only.
31 # CHECK: Name: .llvm_bb_addr_map (1)
32 # CHECK: SectionData (
33 # CHECK-NEXT: 0000: 00000000 00000000
36 # Case 4: Specify Entries.
37 # CHECK: Name: .llvm_bb_addr_map (1)
38 # CHECK: SectionData (
39 # CHECK-NEXT: 0000: 20000000 00000000 01010203
42 # Case 5: Specify Entries and omit the Address field.
43 # CHECK: Name: .llvm_bb_addr_map (1)
45 # CHECK-SAME: {{^ 0x0$}}
46 # CHECK: SectionData (
47 # CHECK-NEXT: 0000: 00000000 00000000 01010203
50 # Case 6: Override the NumBlocks field.
51 # CHECK: Name: .llvm_bb_addr_map (1)
52 # CHECK: SectionData (
53 # CHECK-NEXT: 0000: 20000000 00000000 02010203
63 ## Test the following cases:
65 ## 1) We can produce an .llvm_bb_addr_map section from a description with section
68 - Name: '.llvm_bb_addr_map (1)'
69 Type: SHT_LLVM_BB_ADDR_MAP
70 Content: "000000000000000001010203"
72 ## 2) We can produce an empty .llvm_bb_addr_map section from a description
73 ## with empty section content.
74 - Name: '.llvm_bb_addr_map (2)'
75 Type: SHT_LLVM_BB_ADDR_MAP
77 ## 3) We can produce a zero .llvm_bb_addr_map section of a specific size when
78 ## we specify the size only.
79 - Name: '.llvm_bb_addr_map (3)'
80 Type: SHT_LLVM_BB_ADDR_MAP
83 ## 4) We can produce an .llvm_bb_addr_map section from a description with
85 - Name: '.llvm_bb_addr_map (4)'
86 Type: SHT_LLVM_BB_ADDR_MAP
88 - Address: 0x0000000000000020
90 - AddressOffset: 0x00000001
94 ## 5) When specifying the description with Entries, the 'Address' field will be
96 - Name: '.llvm_bb_addr_map (5)'
97 Type: SHT_LLVM_BB_ADDR_MAP
100 - AddressOffset: 0x00000001
104 ## 6) We can override the NumBlocks field with a value different from the
105 ## actual number of BB Entries.
106 - Name: '.llvm_bb_addr_map (6)'
107 Type: SHT_LLVM_BB_ADDR_MAP
109 - Address: 0x0000000000000020
112 - AddressOffset: 0x00000001
116 ## Check we can't use Entries at the same time as either Content or Size.
117 # RUN: not yaml2obj --docnum=2 -DCONTENT="00" %s 2>&1 | FileCheck %s --check-prefix=INVALID
118 # RUN: not yaml2obj --docnum=2 -DSIZE="0" %s 2>&1 | FileCheck %s --check-prefix=INVALID
120 # INVALID: error: "Entries" cannot be used with "Content" or "Size"
128 ## Specify Content and Size
129 - Name: '.llvm_bb_addr_map'
130 Type: SHT_LLVM_BB_ADDR_MAP
132 Content: [[CONTENT=<none>]]
133 Size: [[SIZE=<none>]]