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

Pengxuan Zheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 16:28:46 PST 2022


pzheng created this revision.
pzheng added reviewers: keith, int3, thakis.
Herald added projects: lld-macho, All.
Herald added a reviewer: lld-macho.
pzheng requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139980

Files:
  lld/test/MachO/stabs.s


Index: lld/test/MachO/stabs.s
===================================================================
--- lld/test/MachO/stabs.s
+++ 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139980.482657.patch
Type: text/x-patch
Size: 735 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221214/d6529e73/attachment.bin>


More information about the llvm-commits mailing list