zatrazz created this revision. zatrazz added reviewers: arichardson, emaste, rupprecht. Herald added a subscriber: kristof.beyls. Herald added a project: LLVM.
The llvm-ar uses localtime to print the object timestamp and it is subject to UTC offset (daylight for instance). The patch changes the test to check against output of a 'date' command. It fixes the D-flag.test failure on some aarch64 and arm bots, which are situated on GMT with currently BST timezone. 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 @@ -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
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 @@ -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
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits