1 ## Check how yaml2obj produces SHT_HASH sections.
3 ## Check we can describe a SHT_HASH section using the "Content" tag.
5 # RUN: yaml2obj --docnum=1 %s -o %t1
6 # RUN: llvm-readobj --sections --section-data %t1 | FileCheck %s --check-prefix=CONTENT
9 # CONTENT-NEXT: Type: SHT_HASH
10 # CONTENT-NEXT: Flags [
12 # CONTENT-NEXT: Address: 0x0
13 # CONTENT-NEXT: Offset: 0x44
14 # CONTENT-NEXT: Size: 20
15 # CONTENT-NEXT: Link: 1
16 # CONTENT-NEXT: Info: 0
17 # CONTENT-NEXT: AddressAlignment: 0
18 # CONTENT-NEXT: EntrySize: 0
19 # CONTENT-NEXT: SectionData (
20 # CONTENT-NEXT: 0000: 01000000 02000000 03000000 04000000
21 # CONTENT-NEXT: 0010: 05000000
31 ## SHT_HASH is linked to dynamic symbol table by default.
36 Content: '0100000002000000030000000400000005000000'
38 ## Check we can describe a SHT_HASH section using "Bucket" and "Chain" tags.
40 # RUN: yaml2obj --docnum=2 %s -o %t2
41 # RUN: llvm-readobj --sections --section-data %t2 | FileCheck %s --check-prefix=BUCKET-CHAIN
43 # BUCKET-CHAIN: Name: .hash
45 # BUCKET-CHAIN-SAME: 28
47 # BUCKET-CHAIN-SAME: 0
48 # BUCKET-CHAIN: SectionData (
49 # BUCKET-CHAIN-NEXT: 0000: 02000000 03000000 01000000 02000000 |
50 # BUCKET-CHAIN-NEXT: 0010: 03000000 04000000 05000000 |
51 # BUCKET-CHAIN-NEXT: )
65 ## Check we can't use "Content" and "Bucket" tags together.
67 # RUN: not yaml2obj --docnum=3 %s 2>&1 | FileCheck %s --check-prefix=CONTENT-BUCKET
69 # CONTENT-BUCKET: error: "Content" and "Bucket" cannot be used together
83 ## Check we can't use "Content" and "Chain" tags together.
85 # RUN: not yaml2obj --docnum=4 %s 2>&1 | FileCheck %s --check-prefix=CONTENT-CHAIN
87 # CONTENT-CHAIN: error: "Content" and "Chain" cannot be used together
101 ## Check we can't use "Bucket" without "Chain".
103 # RUN: not yaml2obj --docnum=5 %s 2>&1 | FileCheck %s --check-prefix=NO-BUCKET-OR-CHAIN
105 # NO-BUCKET-OR-CHAIN: error: "Bucket" and "Chain" must be used together
118 ## Check we can't use "Chain" without "Bucket".
120 # RUN: not yaml2obj --docnum=6 %s 2>&1 | FileCheck %s --check-prefix=NO-BUCKET-OR-CHAIN
133 ## Check we report an error if neither "Bucket", "Chain" nor "Content" were set.
135 # RUN: not yaml2obj --docnum=7 %s 2>&1 | FileCheck %s --check-prefix=NO-TAGS
137 # NO-TAGS: error: one of "Content", "Bucket" or "Chain" must be specified