Summary: A previous patch added support for dumping offloading sections. The tests for this feature added dummy input to the required section using `llvm-objcopy`. This binary format has a required alignment of `8` which was not being respected by the file copied with llvm-objcopy and would cause failures on architectures sensitive to alignment problems or with sanitizers. This patch adds the proper alignemnt and adds an error check at least for the binary format so it's not completely opaque. This should be improvbed so users actually get a helpful message.
18 lines
708 B
Plaintext
18 lines
708 B
Plaintext
## Ensure we give a warning on bad input following good input.
|
|
# RUN: yaml2obj %S/Inputs/binary.yaml -o %t-good.bin
|
|
# RUN: yaml2obj %S/Inputs/malformed.yaml -o %t-bad.bin
|
|
# RUN: cat %t-bad.bin >> %t-good.bin
|
|
# RUN: yaml2obj %s -o %t.elf
|
|
# RUN: llvm-objcopy --add-section .llvm.offloading=%t-good.bin %t.elf
|
|
# RUN: llvm-objcopy --set-section-alignment .llvm.offloading=8 %t.elf
|
|
# RUN: llvm-objdump --offloading %t.elf 2>&1 | FileCheck %s -DFILENAME=%t.elf
|
|
|
|
!ELF
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
Type: ET_EXEC
|
|
|
|
# CHECK: OFFLOADING IMAGE [0]:
|
|
# CHECK: warning: '[[FILENAME]]': while parsing offloading files: The end of the file was unexpectedly encountered
|