brintos

brintos / llvm-project-archived public Read only

0
0
Text · 792 B · d234b58 Raw
28 lines · plain
1# RUN: yaml2obj %s -o %t.o2 3# Writing an empty output to a non-existent file will still create it.4# RUN: rm -f %t-new.txt5# RUN: llvm-objcopy -R .text -O binary %t.o %t-new.txt6# RUN: wc -c %t-new.txt | FileCheck %s7 8# Writing an empty output to an existing file will truncate it.9# RUN: echo abcd > %t-existing.txt10# RUN: llvm-objcopy -R .text -O binary %t.o %t-existing.txt11# RUN: wc -c %t-existing.txt | FileCheck %s12 13# In both cases, the file should be empty.14# CHECK: 015 16!ELF17FileHeader:18  Class:           ELFCLASS6419  Data:            ELFDATA2LSB20  Type:            ET_EXEC21  Machine:         EM_X86_6422Sections:23  - Name:            .text24    Type:            SHT_PROGBITS25    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]26    Content:         "c3c3c3c3"27    Size:            0x100028