1 ## Check how yaml2obj produces SHT_LLVM_ADDRSIG sections.
3 ## Check we can describe SHT_LLVM_ADDRSIG using the "Symbols" tag. We can define
4 ## symbols either using names or indexes.
6 # RUN: yaml2obj --docnum=1 %s -o %t1
7 # RUN: llvm-readobj --sections --section-data %t1 | FileCheck %s --check-prefix=SYMBOLS
11 # SYMBOLS-NEXT: Name: .llvm_addrsig
12 # SYMBOLS-NEXT: Type: SHT_LLVM_ADDRSIG
13 # SYMBOLS-NEXT: Flags [
15 # SYMBOLS-NEXT: Address: 0x0
16 # SYMBOLS-NEXT: Offset: 0x40
17 # SYMBOLS-NEXT: Size: 4
18 # SYMBOLS-NEXT: Link: 2
19 # SYMBOLS-NEXT: Info: 0
20 # SYMBOLS-NEXT: AddressAlignment: 0
21 # SYMBOLS-NEXT: EntrySize: 0
22 # SYMBOLS-NEXT: SectionData (
23 # SYMBOLS-NEXT: 0000: 01020102
35 Type: SHT_LLVM_ADDRSIG
49 ## We can't specify both "Index" and "Name" when defining a symbol.
51 # RUN: not yaml2obj --docnum=2 %s 2>&1 | FileCheck %s --check-prefix=INDEX-NAME
53 # INDEX-NAME: error: "Index" and "Name" cannot be used together when defining a symbol
63 Type: SHT_LLVM_ADDRSIG
72 ## Check we report an error if an unknown symbol is referenced in the
73 ## SHT_LLVM_ADDRSIG section description.
75 # RUN: not yaml2obj --docnum=3 %s 2>&1 | FileCheck %s --check-prefix=SYMBOL-UNKNOWN
77 # SYMBOL-UNKNOWN: error: unknown symbol referenced: 'foo' by YAML section '.llvm_addrsig'
78 # SYMBOL-UNKNOWN: error: unknown symbol referenced: 'bar' by YAML section '.llvm_addrsig'
88 Type: SHT_LLVM_ADDRSIG
93 ## Check we can specify any arbitrary symbol indices.
95 # RUN: yaml2obj --docnum=4 %s -o %t4
96 # RUN: llvm-readobj --sections --section-data %t4 | FileCheck %s --check-prefix=SYMBOL-INDEX
98 # SYMBOL-INDEX: Type: SHT_LLVM_ADDRSIG
99 # SYMBOL-INDEX: SectionData (
100 # SYMBOL-INDEX-NEXT: 0000: 00FF01C4 E6888901 FFFFFFFF 0F
101 # SYMBOL-INDEX-NEXT: )
110 - Name: .llvm_addrsig
111 Type: SHT_LLVM_ADDRSIG
116 ## 0xFFFFFFFF is a maximum allowed index value.
119 ## Check that the maximum symbol index size is 32 bits.
121 # RUN: not yaml2obj --docnum=5 %s 2>&1 | FileCheck %s --check-prefix=SYMBOL-INDEX-OVERFLOW
123 # SYMBOL-INDEX-OVERFLOW: error: out of range hex32 number
132 - Name: .llvm_addrsig
133 Type: SHT_LLVM_ADDRSIG
135 - Index: 0x1122334455
137 ## Check we can use the "Content" tag to specify any data for SHT_LLVM_ADDRSIG sections.
139 # RUN: yaml2obj --docnum=6 %s -o %t6
140 # RUN: llvm-readobj --sections --section-data %t6 | FileCheck %s --check-prefix=CONTENT
142 # CONTENT: Type: SHT_LLVM_ADDRSIG
145 # CONTENT: SectionData (
146 # CONTENT-NEXT: 0000: 11223344 55
156 - Name: .llvm_addrsig
157 Type: SHT_LLVM_ADDRSIG
158 Content: "1122334455"
160 ## Either "Content" or "Symbols" must be specifed for SHT_LLVM_ADDRSIG sections.
162 # RUN: not yaml2obj --docnum=7 %s 2>&1 | FileCheck %s --check-prefix=NO-TAGS
164 # NO-TAGS: error: one of "Content", "Size" or "Symbols" must be specified
173 - Name: .llvm_addrsig
174 Type: SHT_LLVM_ADDRSIG
176 ## "Content" and "Symbols" cannot be used together to describe the SHT_LLVM_ADDRSIG section.
178 # RUN: not yaml2obj --docnum=8 %s 2>&1 | FileCheck %s --check-prefix=CONTENT-SYMBOLS
180 # CONTENT-SYMBOLS: "Symbols" cannot be used with "Content" or "Size"
189 - Name: .llvm_addrsig
190 Type: SHT_LLVM_ADDRSIG
194 ## Check we can set an arbitrary sh_link value for SHT_LLVM_ADDRSIG sections.
196 # RUN: yaml2obj --docnum=9 %s -o %t9
197 # RUN: llvm-readobj --sections %t9 | FileCheck %s --check-prefix=LINK
199 # LINK: Name: .llvm_addrsig
201 # LINK-SAME: 123{{$}}
210 - Name: .llvm_addrsig
211 Type: SHT_LLVM_ADDRSIG
215 ## Check we can use only "Size" to create a SHT_LLVM_ADDRSIG section.
217 # RUN: yaml2obj --docnum=10 %s -o %t10
218 # RUN: llvm-readobj --sections --section-data %t10 | FileCheck %s --check-prefix=SIZE
220 # SIZE: Name: .llvm_addrsig
223 # SIZE: SectionData (
224 # SIZE-NEXT: 0000: 00000000 00000000 00000000 00000000 |
225 # SIZE-NEXT: 0010: 00 |
235 - Name: .llvm_addrsig
236 Type: SHT_LLVM_ADDRSIG
239 ## Check we can use "Size" and "Content" together to create a SHT_LLVM_ADDRSIG section.
241 # RUN: yaml2obj --docnum=11 %s -o %t11
242 # RUN: llvm-readobj --sections --section-data %t11 | FileCheck %s --check-prefix=SIZE-CONTENT
244 # SIZE-CONTENT: Name: .llvm_addrsig_sizegr
245 # SIZE-CONTENT: Size:
246 # SIZE-CONTENT-SAME: 5
247 # SIZE-CONTENT: SectionData (
248 # SIZE-CONTENT-NEXT: 0000: 11223300 00 |
249 # SIZE-CONTENT-NEXT: )
251 # SIZE-CONTENT: Name: .llvm_addrsig_sizeeq
252 # SIZE-CONTENT: Size:
253 # SIZE-CONTENT-SAME: 3
254 # SIZE-CONTENT: SectionData (
255 # SIZE-CONTENT-NEXT: 0000: 112233 |
256 # SIZE-CONTENT-NEXT: )
265 - Name: .llvm_addrsig_sizegr
266 Type: SHT_LLVM_ADDRSIG
269 - Name: .llvm_addrsig_sizeeq
270 Type: SHT_LLVM_ADDRSIG
274 ## Check that when "Size" and "Content" are used together, the size
275 ## must be greater than or equal to the content size.
277 # RUN: not yaml2obj --docnum=12 %s 2>&1 | FileCheck %s --check-prefix=SIZE-CONTENT-ERR
279 # SIZE-CONTENT-ERR: error: "Size" must be greater than or equal to the content size
288 - Name: .llvm_addrsig
289 Type: SHT_LLVM_ADDRSIG
293 ## Check we can't use "Size" and "Symbols" tags together.
295 # RUN: not yaml2obj --docnum=13 %s 2>&1 | FileCheck %s --check-prefix=CONTENT-SYMBOLS
304 - Name: .llvm_addrsig
305 Type: SHT_LLVM_ADDRSIG