1 # RUN: yaml2obj --docnum=1 %s -o %t1
2 # RUN: llvm-readobj --sections %t1 | FileCheck %s
5 # CHECK-NEXT: Type: SHT_PROGBITS
7 # CHECK-NEXT: SHF_ALLOC
8 # CHECK-NEXT: SHF_EXECINSTR
10 # CHECK-NEXT: Address:
13 # CHECK-NEXT: Link: 12345
23 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
26 ## Check we report an error when an unknown section is referenced via a Link field.
28 # RUN: not yaml2obj --docnum=2 %s 2>&1 | FileCheck %s --check-prefix=ERR
30 # ERR: error: unknown section referenced: '.unknown1' by YAML section '.foo'
31 # ERR-NEXT: error: unknown section referenced: '.unknown2' by YAML section '(index 2)'
32 # ERR-NEXT: error: unknown section referenced: '.unknown3' by YAML section '.bar'
33 # ERR-NEXT: error: unknown section referenced: '.unknown4' by YAML section '(index 4)'
52 ## Check we link SHT_GROUP to a symbol table by default if it exists.
53 ## Also, check we can set an arbitrary value for sh_link.
55 # RUN: yaml2obj --docnum=3 %s -o %t3
56 # RUN: llvm-readobj --sections %t3 | FileCheck %s --check-prefix=GROUP-LINK
58 # GROUP-LINK: Name: .group1
62 # GROUP-LINK: Name: .group2
64 # GROUP-LINK-SAME: 255
81 ## Check we set SHT_GROUP's link value to 0 when there is no symbol table.
83 # RUN: yaml2obj --docnum=4 %s -o %t4
84 # RUN: llvm-readobj --sections %t4 | FileCheck %s --check-prefix=GROUP-LINK-NOSYMTAB
86 # GROUP-LINK-NOSYMTAB: Name: .group
87 # GROUP-LINK-NOSYMTAB: Link:
88 # GROUP-LINK-NOSYMTAB-SAME: 0