1## Ensure we give a warning on bad input following good input.
2# RUN: yaml2obj %S/Inputs/binary.yaml -o %t-good.bin
3# RUN: yaml2obj %S/Inputs/malformed.yaml -o %t-bad.bin
4# RUN: cat %t-bad.bin >> %t-good.bin
5# RUN: yaml2obj %s -o %t.elf
6# RUN: llvm-objcopy --update-section .llvm.offloading=%t-good.bin %t.elf
7# RUN: llvm-objdump --offloading %t.elf 2>&1 | FileCheck %s -DFILENAME=%t.elf
8
9!ELF
10FileHeader:
11  Class:           ELFCLASS64
12  Data:            ELFDATA2LSB
13  Type:            ET_EXEC
14Sections:
15  - Name:            .llvm.offloading
16    Type:            SHT_LLVM_OFFLOADING
17    Flags:           [ SHF_EXCLUDE ]
18    AddressAlign:    0x0000000000000008
19
20# CHECK: OFFLOADING IMAGE [0]:
21# CHECK: warning: '[[FILENAME]]': while parsing offloading files: The end of the file was unexpectedly encountered
22