[PATCH] D72449: [PATCH] [llvm-ranlib] Take in consideration UTC offset for D-flag.test

Adhemerval Zanella via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 9 11:20:25 PST 2020


zatrazz updated this revision to Diff 237134.
zatrazz added a comment.

Updated patch based on previous comments.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72449/new/

https://reviews.llvm.org/D72449

Files:
  llvm/test/tools/llvm-ranlib/D-flag.test


Index: llvm/test/tools/llvm-ranlib/D-flag.test
===================================================================
--- llvm/test/tools/llvm-ranlib/D-flag.test
+++ llvm/test/tools/llvm-ranlib/D-flag.test
@@ -10,7 +10,7 @@
 
 ## Check that the -D flag clears the timestamps:
 # RUN: cp %t-no-index.a %t.a && llvm-ranlib -D %t.a
-# RUN: env TZ=UTC llvm-ar tv %t.a | FileCheck %s --check-prefix=DETERMINISTIC-VALUES
+# RUN: (env TZ=UTC date -d '@0' +%H:%M; env TZ=UTC llvm-ar tv %t.a) | FileCheck %s --check-prefix=DETERMINISTIC-VALUES
 
 ## Check that the -U flag maintains the timestamps:
 # RUN: cp %t-no-index.a %t.a && llvm-ranlib -U %t.a
@@ -20,7 +20,7 @@
 # RUN: cp %t-no-index.a %t.a && llvm-ranlib -UDU %t.a
 # RUN: env TZ=UTC llvm-ar tv %t.a | FileCheck %s --check-prefix=REAL-VALUES
 # RUN: cp %t-no-index.a %t.a && llvm-ranlib -UUD %t.a
-# RUN: env TZ=UTC llvm-ar tv %t.a | FileCheck %s --check-prefix=DETERMINISTIC-VALUES
+# RUN: (env TZ=UTC date -d '@0' +%H:%M; env TZ=UTC llvm-ar tv %t.a) | FileCheck %s --check-prefix=DETERMINISTIC-VALUES
 
 ## Check arguments can be passed before and after the file name
 # RUN: cp %t-no-index.a %t.a && llvm-ranlib -U %t.a -D -U
@@ -41,5 +41,8 @@
 # RUN: not llvm-ranlib -DxD %t.a 2>&1 | FileCheck %s --check-prefix=BAD-OPT-xD
 # BAD-OPT-xD: error: Invalid option: '-xD'
 
-# DETERMINISTIC-VALUES: {{[rwx-]+}} 0/0    712 Jan  1 00:00 1970 D-flag.test.tmp.o
+## llvm-ar uses localtime to print the object timestamp and it is subject to
+## UTC offset (daylight for instance).
+# DETERMINISTIC-VALUES: [[HHMM:[0-9]+:[0-9]+]]
+# DETERMINISTIC-VALUES: {{[rwx-]+}} 0/0    712 Jan  1 [[HHMM]] 1970 D-flag.test.tmp.o
 # REAL-VALUES: {{[rwx-]+}} {{[0-9]+}}/{{[0-9]+}} 712 Jan  2 03:04 2000 D-flag.test.tmp.o


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72449.237134.patch
Type: text/x-patch
Size: 1748 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200109/4ea21ffb/attachment.bin>


More information about the llvm-commits mailing list