brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · 1f061ad Raw
88 lines · yaml
1## Check how the "Content", "Size" and "Members" keys can be used to2## describe the content for group sections.3 4## Check we can use the "Content" key with the "Size" key when the size is greater5## than or equal to the content size.6 7# RUN: not yaml2obj -DSIZE=1 -DCONTENT="'0011'" %s 2>&1 | \8# RUN:   FileCheck %s --check-prefix=CONTENT-SIZE-ERR9 10# CONTENT-SIZE-ERR: error: Section size must be greater than or equal to the content size11 12--- !ELF13FileHeader:14  Class: ELFCLASS6415  Data:  ELFDATA2LSB16  Type:  ET_DYN17Sections:18  - Name:    .group19    Type:    SHT_GROUP20    Link:    0x121    Info:    0x222    EntSize: [[ENTSIZE=<none>]]23    Size:    [[SIZE=<none>]]24    Content: [[CONTENT=<none>]]25    Members: [[MEMBERS=<none>]]26 27# RUN: yaml2obj -DSIZE=2 -DCONTENT="'0011'" %s -o %t.cont.size.eq.o28# RUN: llvm-readobj --sections --section-data %t.cont.size.eq.o | \29# RUN:   FileCheck %s --check-prefix=CHECK-CONTENT -DDATA="0011"30 31# RUN: yaml2obj -DSIZE=3 -DCONTENT="'0011'" %s -o %t.cont.size.gr.o32# RUN: llvm-readobj --sections --section-data %t.cont.size.gr.o | \33# RUN:   FileCheck %s --check-prefix=CHECK-CONTENT -DDATA="001100"34 35# CHECK-CONTENT:      Name: .group36# CHECK-CONTENT-NEXT: Type: SHT_GROUP37# CHECK-CONTENT-NEXT: Flags [38# CHECK-CONTENT-NEXT: ]39# CHECK-CONTENT-NEXT: Address:40# CHECK-CONTENT-NEXT: Offset:41# CHECK-CONTENT-NEXT: Size:42# CHECK-CONTENT-NEXT: Link: 143# CHECK-CONTENT-NEXT: Info: 244# CHECK-CONTENT-NEXT: AddressAlignment:45# CHECK-CONTENT-NEXT: EntrySize: 446# CHECK-CONTENT-NEXT: SectionData (47# CHECK-CONTENT-NEXT:   0000: [[DATA]] |48# CHECK-CONTENT-NEXT: )49 50## Check we can use the "Size" key alone to create the section.51 52# RUN: yaml2obj -DSIZE=3 %s -o %t.size.o53# RUN: llvm-readobj --sections --section-data %t.size.o | \54# RUN:   FileCheck %s --check-prefix=CHECK-CONTENT -DDATA="000000"55 56## Check we can use the "Content" key alone to create the section.57 58# RUN: yaml2obj -DCONTENT="'112233'" %s -o %t.content.o59# RUN: llvm-readobj --sections --section-data %t.content.o | \60# RUN:   FileCheck %s --check-prefix=CHECK-CONTENT -DDATA="112233"61 62## Check we can't use the "Members" key together with the "Content" or "Size" keys.63 64# RUN: not yaml2obj -DSIZE=0 -DMEMBERS="[]" %s 2>&1 | \65# RUN:   FileCheck %s --check-prefix=MEMBERS-ERR66# RUN: not yaml2obj -DCONTENT="'00'" -DMEMBERS="[]" %s 2>&1 | \67# RUN:   FileCheck %s --check-prefix=MEMBERS-ERR68 69# MEMBERS-ERR: error: "Members" cannot be used with "Content" or "Size"70 71## Check we create an empty section when none of "Size", "Content" or "Members" are specified.72## Check that the default value of sh_entsize is 4.73 74# RUN: yaml2obj %s -o %t.empty.o75# RUN: llvm-readelf --sections --section-data %t.empty.o | \76# RUN:   FileCheck %s --check-prefix=EMPTY-SEC77 78# EMPTY-SEC: [Nr] Name   Type  Address          Off    Size   ES Flg79# EMPTY-SEC: [ 1] .group GROUP 0000000000000000 000040 000000 04 180 81## Check that we are able to set an arbitrary entry size for the group section.82 83# RUN: yaml2obj %s -DENTSIZE=0xFE -o %t.entsize.o84# RUN: llvm-readelf --sections %t.entsize.o | FileCheck %s --check-prefix=ENTSIZE85 86# ENTSIZE: [Nr] Name   Type  Address          Off    Size   ES Flg87# ENTSIZE: [ 1] .group GROUP 0000000000000000 000040 000000 fe 188