37 lines · yaml
1## Check how SHT_NOBITS sections are created.2 3## Check we can use the "Size" key alone to create the section.4 5# RUN: yaml2obj -DSIZE=3 %s -o %t.size.o6# RUN: llvm-readelf --sections --section-data %t.size.o | FileCheck %s7 8# CHECK: [Nr] Name Type Address Off Size ES Flg Lk Inf Al9# CHECK: [ 1] .nobits NOBITS 0000000000000000 000040 000003 00 0 0 010 11--- !ELF12FileHeader:13 Class: ELFCLASS6414 Data: ELFDATA2LSB15 Type: ET_DYN16Sections:17 - Name: .nobits18 Type: SHT_NOBITS19 Size: [[SIZE=<none>]]20 Content: [[CONTENT=<none>]]21 22## Check we can't use the "Content" key.23 24# RUN: not yaml2obj -DCONTENT="'112233'" %s 2>&1 | \25# RUN: FileCheck %s --check-prefix=CONTENT-ERR26 27# CONTENT-ERR: error: SHT_NOBITS section cannot have "Content"28 29## Check we create an empty section when neither of "Size" nor "Content" are specified.30 31# RUN: yaml2obj %s -o %t.empty.o32# RUN: llvm-readelf --sections --section-data %t.empty.o | \33# RUN: FileCheck %s --check-prefix=EMPTY-SEC34 35# EMPTY-SEC: [Nr] Name Type Address Off Size36# EMPTY-SEC: [ 1] .nobits NOBITS 0000000000000000 000040 00000037