71 lines · plain
1## Note: ls -l prints the modified timestamp2 3## Preserve dates when stripping to an output file.4# RUN: yaml2obj %s -o %t.1.o5# RUN: touch -m -t 199705050555.55 %t.1.o6# RUN: llvm-strip -p %t.1.o -o %t-preserved.1.o7# RUN: ls -l %t-preserved.1.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME8# Check that the stripped output is in fact a valid object file.9# RUN: llvm-readobj %t-preserved.1.o10 11## Preserve dates available via objcopy interface as well.12# RUN: yaml2obj %s -o %t.2.o13# RUN: touch -m -t 199705050555.55 %t.2.o14# RUN: llvm-objcopy -p %t.2.o %t-preserved.2.o15# RUN: ls -l %t-preserved.2.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME16# RUN: llvm-readobj %t-preserved.2.o17 18## Preserve dates when stripping in place.19# RUN: yaml2obj %s -o %t.3.o20# RUN: touch -m -t 199705050555.55 %t.3.o21# RUN: llvm-strip -p %t.3.o22# RUN: ls -l %t.3.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME23# RUN: llvm-readobj %t.3.o24 25## Without -p set, don't preserve dates.26# RUN: yaml2obj %s -o %t.4.o27# RUN: touch -m -t 199705050555.55 %t.4.o28# RUN: llvm-strip %t.4.o29# RUN: ls -l %t.4.o | FileCheck %s --check-prefix=CHECK-NO-PRESERVE-MTIME30# RUN: llvm-readobj %t.4.o31 32## Preserve dates in archives.33# RUN: yaml2obj %s -o %t.5.o34# RUN: rm -f %t.a35# RUN: llvm-ar cr %t.a %t.5.o36# RUN: touch -m -t 199705050555.55 %t.a37# RUN: llvm-strip -p %t.a38# RUN: ls -l %t.a | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME39# RUN: llvm-readobj %t.a40 41## Preserve dates in split DWO files.42# RUN: cp %p/Inputs/dwarf.dwo %t-input.dwo43# RUN: touch -m -t 199705050555.55 %t-input.dwo44# RUN: llvm-objcopy -p --split-dwo=%t-dwo %t-input.dwo %t-nondwo45# RUN: ls -l %t-dwo | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME46# RUN: llvm-readobj %t-dwo47# RUN: ls -l %t-nondwo | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME48# RUN: llvm-readobj %t-nondwo49 50## --preserve-dates and -p are aliases.51# RUN: llvm-strip --preserve-dates %t.1.o -o %t-preserved.1.alias.o52# RUN: ls -l %t-preserved.1.alias.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME53# RUN: cmp %t-preserved.1.alias.o %t-preserved.1.o54# RUN: llvm-objcopy --preserve-dates %t.2.o %t-preserved.2.alias.o55# RUN: ls -l %t-preserved.2.alias.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME56# RUN: cmp %t-preserved.2.o %t-preserved.2.alias.o57 58# CHECK-PRESERVE-MTIME: {{[[:space:]]1997}}59# CHECK-NO-PRESERVE-MTIME-NOT: {{[[:space:]]1997}}60 61!ELF62FileHeader:63 Class: ELFCLASS6464 Data: ELFDATA2LSB65 Type: ET_REL66 Machine: EM_X86_6467Sections:68 - Name: .text69 Type: SHT_PROGBITS70 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]71