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