[llvm] r348354 - [test] Split strip-preserve-time.test, and skip atime test on NetBSD

Michal Gorny via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 5 03:15:46 PST 2018


Author: mgorny
Date: Wed Dec  5 03:15:46 2018
New Revision: 348354

URL: http://llvm.org/viewvc/llvm-project?rev=348354&view=rev
Log:
[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

Added:
    llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-atime.test
      - copied, changed from r348353, llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-time.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-mtime.test
      - copied, changed from r348353, llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-time.test
Removed:
    llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-time.test
Modified:
    llvm/trunk/utils/lit/lit/llvm/config.py

Copied: llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-atime.test (from r348353, llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-time.test)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-atime.test?p2=llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-atime.test&p1=llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-time.test&r1=348353&r2=348354&rev=348354&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-time.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-atime.test Wed Dec  5 03:15:46 2018
@@ -1,40 +1,34 @@
-# Note: ls -lu prints the accessed timestamp, ls -l prints the modified timestamp
+# Note: ls -lu prints the accessed timestamp
+# NetBSD: noatime mounts currently inhibit 'touch -a' updates
+# UNSUPPORTED: system-netbsd
 
 # Preserve dates when stripping to an output file.
 # RUN: yaml2obj %s > %t.1.o
 # RUN: touch -a -t 199505050555.55 %t.1.o
-# RUN: touch -m -t 199705050555.55 %t.1.o
 # RUN: llvm-strip -p %t.1.o -o %t-preserved.1.o
 # RUN: ls -lu %t-preserved.1.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
-# RUN: ls -l %t-preserved.1.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
 # Check that the stripped output is in fact a valid object file.
 # RUN: llvm-readobj %t-preserved.1.o
 
 # Preserve dates available via objcopy interface as well.
 # RUN: yaml2obj %s > %t.2.o
 # RUN: touch -a -t 199505050555.55 %t.2.o
-# RUN: touch -m -t 199705050555.55 %t.2.o
 # RUN: llvm-objcopy -p %t.2.o %t-preserved.2.o
 # RUN: ls -lu %t-preserved.2.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
-# RUN: ls -l %t-preserved.2.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
 # RUN: llvm-readobj %t-preserved.2.o
 
 # Preserve dates when stripping in place.
 # RUN: yaml2obj %s > %t.3.o
 # RUN: touch -a -t 199505050555.55 %t.3.o
-# RUN: touch -m -t 199705050555.55 %t.3.o
 # RUN: llvm-strip -p %t.3.o
 # RUN: ls -lu %t.3.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
-# RUN: ls -l %t.3.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
 # RUN: llvm-readobj %t.3.o
 
 # Without -p set, don't preserve dates.
 # RUN: yaml2obj %s > %t.4.o
 # RUN: touch -a -t 199505050555.55 %t.4.o
-# RUN: touch -m -t 199705050555.55 %t.4.o
 # RUN: llvm-strip %t.4.o
 # RUN: ls -lu %t.4.o | FileCheck %s --check-prefix=CHECK-NO-PRESERVE-ATIME
-# RUN: ls -l %t.4.o | FileCheck %s --check-prefix=CHECK-NO-PRESERVE-MTIME
 # RUN: llvm-readobj %t.4.o
 
 # Preserve dates in archives.
@@ -42,29 +36,21 @@
 # RUN: rm -f %t.a
 # RUN: llvm-ar cr %t.a %t.5.o
 # RUN: touch -a -t 199505050555.55 %t.a
-# RUN: touch -m -t 199705050555.55 %t.a
 # RUN: llvm-strip -p %t.a
 # RUN: ls -lu %t.a | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
-# RUN: ls -l %t.a | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
 # RUN: llvm-readobj %t.a
 
 # Preserve dates in split DWO files.
 # RUN: cp %p/Inputs/dwarf.dwo %t-input.dwo
 # RUN: touch -a -t 199505050555.55 %t-input.dwo
-# RUN: touch -m -t 199705050555.55 %t-input.dwo
 # RUN: llvm-objcopy -p -split-dwo=%t-dwo %t-input.dwo %t-nondwo
 # RUN: ls -lu %t-dwo | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
-# RUN: ls -l %t-dwo | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
 # RUN: llvm-readobj %t-dwo
 # RUN: ls -lu %t-nondwo | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
-# RUN: ls -l %t-nondwo | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
 # RUN: llvm-readobj %t-nondwo
 
 # CHECK-PRESERVE-ATIME:        {{[[:space:]]1995}}
-# CHECK-PRESERVE-MTIME:        {{[[:space:]]1997}}
-
 # CHECK-NO-PRESERVE-ATIME-NOT: {{[[:space:]]1995}}
-# CHECK-NO-PRESERVE-MTIME-NOT: {{[[:space:]]1997}}
 
 !ELF
 FileHeader:

Copied: llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-mtime.test (from r348353, llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-time.test)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-mtime.test?p2=llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-mtime.test&p1=llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-time.test&r1=348353&r2=348354&rev=348354&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-time.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-mtime.test Wed Dec  5 03:15:46 2018
@@ -1,39 +1,31 @@
-# Note: ls -lu prints the accessed timestamp, ls -l prints the modified timestamp
+# Note: ls -l prints the modified timestamp
 
 # Preserve dates when stripping to an output file.
 # RUN: yaml2obj %s > %t.1.o
-# RUN: touch -a -t 199505050555.55 %t.1.o
 # RUN: touch -m -t 199705050555.55 %t.1.o
 # RUN: llvm-strip -p %t.1.o -o %t-preserved.1.o
-# RUN: ls -lu %t-preserved.1.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
 # RUN: ls -l %t-preserved.1.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
 # Check that the stripped output is in fact a valid object file.
 # RUN: llvm-readobj %t-preserved.1.o
 
 # Preserve dates available via objcopy interface as well.
 # RUN: yaml2obj %s > %t.2.o
-# RUN: touch -a -t 199505050555.55 %t.2.o
 # RUN: touch -m -t 199705050555.55 %t.2.o
 # RUN: llvm-objcopy -p %t.2.o %t-preserved.2.o
-# RUN: ls -lu %t-preserved.2.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
 # RUN: ls -l %t-preserved.2.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
 # RUN: llvm-readobj %t-preserved.2.o
 
 # Preserve dates when stripping in place.
 # RUN: yaml2obj %s > %t.3.o
-# RUN: touch -a -t 199505050555.55 %t.3.o
 # RUN: touch -m -t 199705050555.55 %t.3.o
 # RUN: llvm-strip -p %t.3.o
-# RUN: ls -lu %t.3.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
 # RUN: ls -l %t.3.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
 # RUN: llvm-readobj %t.3.o
 
 # Without -p set, don't preserve dates.
 # RUN: yaml2obj %s > %t.4.o
-# RUN: touch -a -t 199505050555.55 %t.4.o
 # RUN: touch -m -t 199705050555.55 %t.4.o
 # RUN: llvm-strip %t.4.o
-# RUN: ls -lu %t.4.o | FileCheck %s --check-prefix=CHECK-NO-PRESERVE-ATIME
 # RUN: ls -l %t.4.o | FileCheck %s --check-prefix=CHECK-NO-PRESERVE-MTIME
 # RUN: llvm-readobj %t.4.o
 
@@ -41,29 +33,21 @@
 # RUN: yaml2obj %s > %t.5.o
 # RUN: rm -f %t.a
 # RUN: llvm-ar cr %t.a %t.5.o
-# RUN: touch -a -t 199505050555.55 %t.a
 # RUN: touch -m -t 199705050555.55 %t.a
 # RUN: llvm-strip -p %t.a
-# RUN: ls -lu %t.a | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
 # RUN: ls -l %t.a | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
 # RUN: llvm-readobj %t.a
 
 # Preserve dates in split DWO files.
 # RUN: cp %p/Inputs/dwarf.dwo %t-input.dwo
-# RUN: touch -a -t 199505050555.55 %t-input.dwo
 # RUN: touch -m -t 199705050555.55 %t-input.dwo
 # RUN: llvm-objcopy -p -split-dwo=%t-dwo %t-input.dwo %t-nondwo
-# RUN: ls -lu %t-dwo | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
 # RUN: ls -l %t-dwo | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
 # RUN: llvm-readobj %t-dwo
-# RUN: ls -lu %t-nondwo | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
 # RUN: ls -l %t-nondwo | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
 # RUN: llvm-readobj %t-nondwo
 
-# CHECK-PRESERVE-ATIME:        {{[[:space:]]1995}}
 # CHECK-PRESERVE-MTIME:        {{[[:space:]]1997}}
-
-# CHECK-NO-PRESERVE-ATIME-NOT: {{[[:space:]]1995}}
 # CHECK-NO-PRESERVE-MTIME-NOT: {{[[:space:]]1997}}
 
 !ELF

Removed: llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-time.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-time.test?rev=348353&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-time.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/strip-preserve-time.test (removed)
@@ -1,78 +0,0 @@
-# Note: ls -lu prints the accessed timestamp, ls -l prints the modified timestamp
-
-# Preserve dates when stripping to an output file.
-# RUN: yaml2obj %s > %t.1.o
-# RUN: touch -a -t 199505050555.55 %t.1.o
-# RUN: touch -m -t 199705050555.55 %t.1.o
-# RUN: llvm-strip -p %t.1.o -o %t-preserved.1.o
-# RUN: ls -lu %t-preserved.1.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
-# RUN: ls -l %t-preserved.1.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
-# Check that the stripped output is in fact a valid object file.
-# RUN: llvm-readobj %t-preserved.1.o
-
-# Preserve dates available via objcopy interface as well.
-# RUN: yaml2obj %s > %t.2.o
-# RUN: touch -a -t 199505050555.55 %t.2.o
-# RUN: touch -m -t 199705050555.55 %t.2.o
-# RUN: llvm-objcopy -p %t.2.o %t-preserved.2.o
-# RUN: ls -lu %t-preserved.2.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
-# RUN: ls -l %t-preserved.2.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
-# RUN: llvm-readobj %t-preserved.2.o
-
-# Preserve dates when stripping in place.
-# RUN: yaml2obj %s > %t.3.o
-# RUN: touch -a -t 199505050555.55 %t.3.o
-# RUN: touch -m -t 199705050555.55 %t.3.o
-# RUN: llvm-strip -p %t.3.o
-# RUN: ls -lu %t.3.o | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
-# RUN: ls -l %t.3.o | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
-# RUN: llvm-readobj %t.3.o
-
-# Without -p set, don't preserve dates.
-# RUN: yaml2obj %s > %t.4.o
-# RUN: touch -a -t 199505050555.55 %t.4.o
-# RUN: touch -m -t 199705050555.55 %t.4.o
-# RUN: llvm-strip %t.4.o
-# RUN: ls -lu %t.4.o | FileCheck %s --check-prefix=CHECK-NO-PRESERVE-ATIME
-# RUN: ls -l %t.4.o | FileCheck %s --check-prefix=CHECK-NO-PRESERVE-MTIME
-# RUN: llvm-readobj %t.4.o
-
-# Preserve dates in archives.
-# RUN: yaml2obj %s > %t.5.o
-# RUN: rm -f %t.a
-# RUN: llvm-ar cr %t.a %t.5.o
-# RUN: touch -a -t 199505050555.55 %t.a
-# RUN: touch -m -t 199705050555.55 %t.a
-# RUN: llvm-strip -p %t.a
-# RUN: ls -lu %t.a | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
-# RUN: ls -l %t.a | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
-# RUN: llvm-readobj %t.a
-
-# Preserve dates in split DWO files.
-# RUN: cp %p/Inputs/dwarf.dwo %t-input.dwo
-# RUN: touch -a -t 199505050555.55 %t-input.dwo
-# RUN: touch -m -t 199705050555.55 %t-input.dwo
-# RUN: llvm-objcopy -p -split-dwo=%t-dwo %t-input.dwo %t-nondwo
-# RUN: ls -lu %t-dwo | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
-# RUN: ls -l %t-dwo | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
-# RUN: llvm-readobj %t-dwo
-# RUN: ls -lu %t-nondwo | FileCheck %s --check-prefix=CHECK-PRESERVE-ATIME
-# RUN: ls -l %t-nondwo | FileCheck %s --check-prefix=CHECK-PRESERVE-MTIME
-# RUN: llvm-readobj %t-nondwo
-
-# CHECK-PRESERVE-ATIME:        {{[[:space:]]1995}}
-# CHECK-PRESERVE-MTIME:        {{[[:space:]]1997}}
-
-# CHECK-NO-PRESERVE-ATIME-NOT: {{[[:space:]]1995}}
-# CHECK-NO-PRESERVE-MTIME-NOT: {{[[:space:]]1997}}
-
-!ELF
-FileHeader:
-  Class:           ELFCLASS64
-  Data:            ELFDATA2LSB
-  Type:            ET_REL
-  Machine:         EM_X86_64
-Sections:
-  - Name:            .text
-    Type:            SHT_PROGBITS
-    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]

Modified: llvm/trunk/utils/lit/lit/llvm/config.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/llvm/config.py?rev=348354&r1=348353&r2=348354&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/llvm/config.py (original)
+++ llvm/trunk/utils/lit/lit/llvm/config.py Wed Dec  5 03:15:46 2018
@@ -59,6 +59,8 @@ class LLVMConfig(object):
             features.add('system-linux')
         elif platform.system() in ['FreeBSD']:
             config.available_features.add('system-freebsd')
+        elif platform.system() == "NetBSD":
+            features.add('system-netbsd')
 
         # Native compilation: host arch == default triple arch
         # Both of these values should probably be in every site config (e.g. as
@@ -490,4 +492,4 @@ class LLVMConfig(object):
         if wasm_ld:
             tool_substitutions.append(ToolSubst('wasm-ld', command=wasm_ld))
         self.add_tool_substitutions(tool_substitutions)
-        return was_found
\ No newline at end of file
+        return was_found




More information about the llvm-commits mailing list