50 lines · plain
1## Check that llvm-objcopy reports a suitable error when it2## encounters invalid input during reading.3 4## Failed to read section data.5# RUN: yaml2obj %s --docnum=1 -o %t16# RUN: not llvm-objcopy %t1 %t1.out 2>&1 | FileCheck %s -DFILE=%t1 --check-prefix=ERROR17 8# ERROR1: error: '[[FILE]]': The end of the file was unexpectedly encountered: section data with offset 0x70 and size 0x20 goes past the end of the file9 10--- !XCOFF11FileHeader:12 MagicNumber: 0x01DF13Sections:14 - SectionData: '00007400'15 FileOffsetToData: 0x7016 Size: 0x2017 18## Failed to read relocations.19# RUN: yaml2obj %s --docnum=2 -o %t220# RUN: not llvm-objcopy %t2 %t2.out 2>&1 | FileCheck %s -DFILE=%t2 --check-prefix=ERROR221 22# ERROR2: error: '[[FILE]]': The end of the file was unexpectedly encountered: relocations with offset 0x3c and size 0x1e go past the end of the file23 24--- !XCOFF25FileHeader:26 MagicNumber: 0x01DF27Sections:28 - NumberOfRelocations: 0x329 Relocations:30 - Address: 0xE31 Symbol: 0x1232 Info: 0xF33 Type: 0x334 35## Failed to read the symbols.36# RUN: yaml2obj %s --docnum=3 -o %t337# RUN: not llvm-objcopy %t3 %t3.out 2>&1 | FileCheck %s -DFILE=%t3 --check-prefix=ERROR338 39# ERROR3: error: '[[FILE]]': The end of the file was unexpectedly encountered: symbol table with offset 0x15 and size 0x36 goes past the end of the file40 41--- !XCOFF42FileHeader:43 MagicNumber: 0x01DF44 OffsetToSymbolTable: 0x1545 EntriesInSymbolTable: 346Symbols:47 - Name: foo48 AuxEntries:49 - Type: AUX_CSECT50