• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Note: ls -lu prints the accessed timestamp
2# NetBSD: noatime mounts currently inhibit 'touch -a' updates
3# Windows: the last access time is disabled by default in the OS
4# UNSUPPORTED: system-netbsd, system-windows
5
6# Preserve dates when stripping to an output file.
7# RUN: yaml2obj %s -o %t.1.o
8# RUN: touch -a -t 199505050555.55 %t.1.o
9# RUN: llvm-strip -p %t.1.o -o %t-preserved.1.o
10# RUN: ls -lu %t-preserved.1.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
11# Check that the stripped output is in fact a valid object file.
12# RUN: llvm-readobj %t-preserved.1.o
13
14# Preserve dates available via objcopy interface as well.
15# RUN: yaml2obj %s -o %t.2.o
16# RUN: touch -a -t 199505050555.55 %t.2.o
17# RUN: llvm-objcopy -p %t.2.o %t-preserved.2.o
18# RUN: ls -lu %t-preserved.2.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
19# RUN: llvm-readobj %t-preserved.2.o
20
21# Preserve dates when stripping in place.
22# RUN: yaml2obj %s -o %t.3.o
23# RUN: touch -a -t 199505050555.55 %t.3.o
24# RUN: llvm-strip -p %t.3.o
25# RUN: ls -lu %t.3.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
26# RUN: llvm-readobj %t.3.o
27
28# Without -p set, don't preserve dates.
29# RUN: yaml2obj %s -o %t.4.o
30# RUN: touch -a -t 199505050555.55 %t.4.o
31# RUN: llvm-strip %t.4.o
32# RUN: ls -lu %t.4.o | FileCheck %s --check-prefix=CHECK-NO-PRESERVE-ATIME
33# RUN: llvm-readobj %t.4.o
34
35# Preserve dates in archives.
36# RUN: yaml2obj %s -o %t.5.o
37# RUN: rm -f %t.a
38# RUN: llvm-ar cr %t.a %t.5.o
39# RUN: touch -a -t 199505050555.55 %t.a
40# RUN: llvm-strip -p %t.a
41# RUN: ls -lu %t.a | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
42# RUN: llvm-readobj %t.a
43
44# Preserve dates in split DWO files.
45# RUN: cp %p/Inputs/dwarf.dwo %t-input.dwo
46# RUN: touch -a -t 199505050555.55 %t-input.dwo
47# RUN: llvm-objcopy -p --split-dwo=%t-dwo %t-input.dwo %t-nondwo
48# RUN: ls -lu %t-dwo | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
49# RUN: llvm-readobj %t-dwo
50# RUN: ls -lu %t-nondwo | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
51# RUN: llvm-readobj %t-nondwo
52
53# CHECK-PRESERVE-ATIME:        {{[[:space:]]1995}}
54# CHECK-NO-PRESERVE-ATIME-NOT: {{[[:space:]]1995}}
55
56!ELF
57FileHeader:
58  Class:           ELFCLASS64
59  Data:            ELFDATA2LSB
60  Type:            ET_REL
61  Machine:         EM_X86_64
62Sections:
63  - Name:            .text
64    Type:            SHT_PROGBITS
65    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
66