llvm.org GIT mirror llvm / 8dc1a1a
[test] Split strip-preserve-time.test, and skip atime test on NetBSD Split timestamp preservation tests into atime and mtime test, and skip the former on NetBSD. When the filesystem is mounted noatime, NetBSD not only inhibits implicit atime updates but also prevents setting atime via utime(), causing the test to fail. Differential Revision: https://reviews.llvm.org/D55271 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348354 91177308-0d34-0410-b5e6-96231b3b80d8 Michal Gorny 11 months ago
4 changed file(s) with 129 addition(s) and 79 deletion(s). Raw diff Collapse all Expand all
0 # Note: ls -lu prints the accessed timestamp
1 # NetBSD: noatime mounts currently inhibit 'touch -a' updates
2 # UNSUPPORTED: system-netbsd
3
4 # Preserve dates when stripping to an output file.
5 # RUN: yaml2obj %s > %t.1.o
6 # RUN: touch -a -t 199505050555.55 %t.1.o
7 # RUN: llvm-strip -p %t.1.o -o %t-preserved.1.o
8 # RUN: ls -lu %t-preserved.1.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
9 # Check that the stripped output is in fact a valid object file.
10 # RUN: llvm-readobj %t-preserved.1.o
11
12 # Preserve dates available via objcopy interface as well.
13 # RUN: yaml2obj %s > %t.2.o
14 # RUN: touch -a -t 199505050555.55 %t.2.o
15 # RUN: llvm-objcopy -p %t.2.o %t-preserved.2.o
16 # RUN: ls -lu %t-preserved.2.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
17 # RUN: llvm-readobj %t-preserved.2.o
18
19 # Preserve dates when stripping in place.
20 # RUN: yaml2obj %s > %t.3.o
21 # RUN: touch -a -t 199505050555.55 %t.3.o
22 # RUN: llvm-strip -p %t.3.o
23 # RUN: ls -lu %t.3.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
24 # RUN: llvm-readobj %t.3.o
25
26 # Without -p set, don't preserve dates.
27 # RUN: yaml2obj %s > %t.4.o
28 # RUN: touch -a -t 199505050555.55 %t.4.o
29 # RUN: llvm-strip %t.4.o
30 # RUN: ls -lu %t.4.o | FileCheck %s --check-prefix=CHECK-NO-PRESERVE-ATIME
31 # RUN: llvm-readobj %t.4.o
32
33 # Preserve dates in archives.
34 # RUN: yaml2obj %s > %t.5.o
35 # RUN: rm -f %t.a
36 # RUN: llvm-ar cr %t.a %t.5.o
37 # RUN: touch -a -t 199505050555.55 %t.a
38 # RUN: llvm-strip -p %t.a
39 # RUN: ls -lu %t.a | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
40 # RUN: llvm-readobj %t.a
41
42 # Preserve dates in split DWO files.
43 # RUN: cp %p/Inputs/dwarf.dwo %t-input.dwo
44 # RUN: touch -a -t 199505050555.55 %t-input.dwo
45 # RUN: llvm-objcopy -p -split-dwo=%t-dwo %t-input.dwo %t-nondwo
46 # RUN: ls -lu %t-dwo | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
47 # RUN: llvm-readobj %t-dwo
48 # RUN: ls -lu %t-nondwo | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
49 # RUN: llvm-readobj %t-nondwo
50
51 # CHECK-PRESERVE-ATIME: {{[[:space:]]1995}}
52 # CHECK-NO-PRESERVE-ATIME-NOT: {{[[:space:]]1995}}
53
54 !ELF
55 FileHeader:
56 Class: ELFCLASS64
57 Data: ELFDATA2LSB
58 Type: ET_REL
59 Machine: EM_X86_64
60 Sections:
61 - Name: .text
62 Type: SHT_PROGBITS
63 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
0 # Note: ls -l prints the modified timestamp
1
2 # Preserve dates when stripping to an output file.
3 # RUN: yaml2obj %s > %t.1.o
4 # RUN: touch -m -t 199705050555.55 %t.1.o
5 # RUN: llvm-strip -p %t.1.o -o %t-preserved.1.o
6 # RUN: ls -l %t-preserved.1.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
7 # Check that the stripped output is in fact a valid object file.
8 # RUN: llvm-readobj %t-preserved.1.o
9
10 # Preserve dates available via objcopy interface as well.
11 # RUN: yaml2obj %s > %t.2.o
12 # RUN: touch -m -t 199705050555.55 %t.2.o
13 # RUN: llvm-objcopy -p %t.2.o %t-preserved.2.o
14 # RUN: ls -l %t-preserved.2.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
15 # RUN: llvm-readobj %t-preserved.2.o
16
17 # Preserve dates when stripping in place.
18 # RUN: yaml2obj %s > %t.3.o
19 # RUN: touch -m -t 199705050555.55 %t.3.o
20 # RUN: llvm-strip -p %t.3.o
21 # RUN: ls -l %t.3.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
22 # RUN: llvm-readobj %t.3.o
23
24 # Without -p set, don't preserve dates.
25 # RUN: yaml2obj %s > %t.4.o
26 # RUN: touch -m -t 199705050555.55 %t.4.o
27 # RUN: llvm-strip %t.4.o
28 # RUN: ls -l %t.4.o | FileCheck %s --check-prefix=CHECK-NO-PRESERVE-MTIME
29 # RUN: llvm-readobj %t.4.o
30
31 # Preserve dates in archives.
32 # RUN: yaml2obj %s > %t.5.o
33 # RUN: rm -f %t.a
34 # RUN: llvm-ar cr %t.a %t.5.o
35 # RUN: touch -m -t 199705050555.55 %t.a
36 # RUN: llvm-strip -p %t.a
37 # RUN: ls -l %t.a | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
38 # RUN: llvm-readobj %t.a
39
40 # Preserve dates in split DWO files.
41 # RUN: cp %p/Inputs/dwarf.dwo %t-input.dwo
42 # RUN: touch -m -t 199705050555.55 %t-input.dwo
43 # RUN: llvm-objcopy -p -split-dwo=%t-dwo %t-input.dwo %t-nondwo
44 # RUN: ls -l %t-dwo | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
45 # RUN: llvm-readobj %t-dwo
46 # RUN: ls -l %t-nondwo | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
47 # RUN: llvm-readobj %t-nondwo
48
49 # CHECK-PRESERVE-MTIME: {{[[:space:]]1997}}
50 # CHECK-NO-PRESERVE-MTIME-NOT: {{[[:space:]]1997}}
51
52 !ELF
53 FileHeader:
54 Class: ELFCLASS64
55 Data: ELFDATA2LSB
56 Type: ET_REL
57 Machine: EM_X86_64
58 Sections:
59 - Name: .text
60 Type: SHT_PROGBITS
61 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+0
-78
test/tools/llvm-objcopy/ELF/strip-preserve-time.test less more
None # Note: ls -lu prints the accessed timestamp, ls -l prints the modified timestamp
1
2 # Preserve dates when stripping to an output file.
3 # RUN: yaml2obj %s > %t.1.o
4 # RUN: touch -a -t 199505050555.55 %t.1.o
5 # RUN: touch -m -t 199705050555.55 %t.1.o
6 # RUN: llvm-strip -p %t.1.o -o %t-preserved.1.o
7 # RUN: ls -lu %t-preserved.1.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
8 # RUN: ls -l %t-preserved.1.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
9 # Check that the stripped output is in fact a valid object file.
10 # RUN: llvm-readobj %t-preserved.1.o
11
12 # Preserve dates available via objcopy interface as well.
13 # RUN: yaml2obj %s > %t.2.o
14 # RUN: touch -a -t 199505050555.55 %t.2.o
15 # RUN: touch -m -t 199705050555.55 %t.2.o
16 # RUN: llvm-objcopy -p %t.2.o %t-preserved.2.o
17 # RUN: ls -lu %t-preserved.2.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
18 # RUN: ls -l %t-preserved.2.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
19 # RUN: llvm-readobj %t-preserved.2.o
20
21 # Preserve dates when stripping in place.
22 # RUN: yaml2obj %s > %t.3.o
23 # RUN: touch -a -t 199505050555.55 %t.3.o
24 # RUN: touch -m -t 199705050555.55 %t.3.o
25 # RUN: llvm-strip -p %t.3.o
26 # RUN: ls -lu %t.3.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
27 # RUN: ls -l %t.3.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
28 # RUN: llvm-readobj %t.3.o
29
30 # Without -p set, don't preserve dates.
31 # RUN: yaml2obj %s > %t.4.o
32 # RUN: touch -a -t 199505050555.55 %t.4.o
33 # RUN: touch -m -t 199705050555.55 %t.4.o
34 # RUN: llvm-strip %t.4.o
35 # RUN: ls -lu %t.4.o | FileCheck %s --check-prefix=CHECK-NO-PRESERVE-ATIME
36 # RUN: ls -l %t.4.o | FileCheck %s --check-prefix=CHECK-NO-PRESERVE-MTIME
37 # RUN: llvm-readobj %t.4.o
38
39 # Preserve dates in archives.
40 # RUN: yaml2obj %s > %t.5.o
41 # RUN: rm -f %t.a
42 # RUN: llvm-ar cr %t.a %t.5.o
43 # RUN: touch -a -t 199505050555.55 %t.a
44 # RUN: touch -m -t 199705050555.55 %t.a
45 # RUN: llvm-strip -p %t.a
46 # RUN: ls -lu %t.a | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
47 # RUN: ls -l %t.a | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
48 # RUN: llvm-readobj %t.a
49
50 # Preserve dates in split DWO files.
51 # RUN: cp %p/Inputs/dwarf.dwo %t-input.dwo
52 # RUN: touch -a -t 199505050555.55 %t-input.dwo
53 # RUN: touch -m -t 199705050555.55 %t-input.dwo
54 # RUN: llvm-objcopy -p -split-dwo=%t-dwo %t-input.dwo %t-nondwo
55 # RUN: ls -lu %t-dwo | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
56 # RUN: ls -l %t-dwo | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
57 # RUN: llvm-readobj %t-dwo
58 # RUN: ls -lu %t-nondwo | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
59 # RUN: ls -l %t-nondwo | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
60 # RUN: llvm-readobj %t-nondwo
61
62 # CHECK-PRESERVE-ATIME: {{[[:space:]]1995}}
63 # CHECK-PRESERVE-MTIME: {{[[:space:]]1997}}
64
65 # CHECK-NO-PRESERVE-ATIME-NOT: {{[[:space:]]1995}}
66 # CHECK-NO-PRESERVE-MTIME-NOT: {{[[:space:]]1997}}
67
68 !ELF
69 FileHeader:
70 Class: ELFCLASS64
71 Data: ELFDATA2LSB
72 Type: ET_REL
73 Machine: EM_X86_64
74 Sections:
75 - Name: .text
76 Type: SHT_PROGBITS
77 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
5858 features.add('system-linux')
5959 elif platform.system() in ['FreeBSD']:
6060 config.available_features.add('system-freebsd')
61 elif platform.system() == "NetBSD":
62 features.add('system-netbsd')
6163
6264 # Native compilation: host arch == default triple arch
6365 # Both of these values should probably be in every site config (e.g. as
489491 if wasm_ld:
490492 tool_substitutions.append(ToolSubst('wasm-ld', command=wasm_ld))
491493 self.add_tool_substitutions(tool_substitutions)
492 return was_found
494 return was_found