[lld] 3c9f479 - [lld-macho][test][nfc] Update stabs.s to use touch -d instead of -t

Pengxuan Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 17:05:56 PST 2022


Author: Pengxuan Zheng
Date: 2022-12-13T17:05:46-08:00
New Revision: 3c9f479a5e47d5f3de07ccac365589dd928bfd20

URL: https://github.com/llvm/llvm-project/commit/3c9f479a5e47d5f3de07ccac365589dd928bfd20
DIFF: https://github.com/llvm/llvm-project/commit/3c9f479a5e47d5f3de07ccac365589dd928bfd20.diff

LOG: [lld-macho][test][nfc] Update stabs.s to use touch -d instead of -t

The test currently uses `touch -t` (e.g., `env TZ=UTC touch -t
"197001010000.16"`) to set file timestamps. However, this does not seem to set
the time zone correctly in a singularity container. While this is probably a
bug/limitation of the singularity container, but we can instead use `touch
-d` (e.g., `touch -d "1970-01-01 00:00:16 UTC"`) to achieve the same result
without relying on a fix from singularity. Thoughts?

Reviewed By: int3, #lld-macho

Differential Revision: https://reviews.llvm.org/D139980

Added: 
    

Modified: 
    lld/test/MachO/stabs.s

Removed: 
    


################################################################################
diff  --git a/lld/test/MachO/stabs.s b/lld/test/MachO/stabs.s
index b10793fae1572..18d72e855b8dc 100644
--- a/lld/test/MachO/stabs.s
+++ b/lld/test/MachO/stabs.s
@@ -5,8 +5,8 @@
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/no-debug.s -o %t/no-debug.o
 ## Set modtimes of the files for deterministic test output.
-# RUN: env TZ=UTC touch -t "197001010000.16" %t/test.o
-# RUN: env TZ=UTC touch -t "197001010000.32" %t/foo.o
+# RUN: touch -d "1970-01-01 00:00:16 UTC" %t/test.o
+# RUN: touch -d "1970-01-01 00:00:32 UTC" %t/foo.o
 # RUN: llvm-ar rcsU %t/foo.a %t/foo.o
 
 # RUN: ZERO_AR_DATE=0 %lld -lSystem %t/test.o %t/foo.o %t/no-debug.o -o %t/test


        


More information about the llvm-commits mailing list