<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/69250>69250</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libcxx][tests] Unit tests fail for std::chrono
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc++
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
AntonRydahl
</td>
</tr>
</table>
<pre>
I have three LIT tests failing from `ninja check-cxx` on upstream main on my local machine. I am uncertain whether the tests or code is wrong, but the check fails because the expected time zone in the tests do not match the output. I ran the tests on an AMD EPYC 7402 with Red Hat Enterprise Linux 8.8 and I am currently in GMT-7. The failed tests are
```
Failed Tests (3):
llvm-libc++-shared.cfg.in :: std/time/time.syn/formatter.file_time.pass.cpp
llvm-libc++-shared.cfg.in :: std/time/time.syn/formatter.local_time.pass.cpp
llvm-libc++-shared.cfg.in :: std/time/time.syn/formatter.sys_time.pass.cpp
```
and the output is
```
# .---command stderr------------
# |
# | Format string {:L%%c='%c'%t%%Ec='%Ec'%n}
# | Expected output %c='jeu. 01 janv. 1970 00:00:00 GMT' %Ec='jeu. 01 janv. 1970 00:00:00 GMT'
# |
# | Actual output %c='jeu. 01 janv. 1970 00:00:00 UTC' %Ec='jeu. 01 janv. 1970 00:00:00 UTC'
# |
# | t.tmp.exe: /g/g92/rydahl1/LLVM_FORK/llvm-project/libcxx/test/std/time/time.syn/formatter_tests.h:41: void check(std::basic_string_view<CharT>, test_format_string<CharT, Args...>, Args &&...) [CharT = char, Args = <std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long long>>>]: Assertion `out == expected' failed.
# `-----------------------------
# error: command failed with exit status: 250
...
# .---command stderr------------
# |
# | Format string {:L%%c='%c'%t%%Ec='%Ec'%n}
# | Expected output %c='jeu. 01 janv. 1970 00:00:00 GMT' %Ec='jeu. 01 janv. 1970 00:00:00 GMT'
# |
# | Actual output %c='jeu. 01 janv. 1970 00:00:00 UTC' %Ec='jeu. 01 janv. 1970 00:00:00 UTC'
# |
# | t.tmp.exe: /g/g92/rydahl1/LLVM_FORK/llvm-project/libcxx/test/std/time/time.syn/formatter_tests.h:41: void check(std::basic_string_view<CharT>, test_format_string<CharT, Args...>, Args &&...) [CharT = char, Args = <std::chrono::time_point<std::filesystem::_FilesystemClock, std::chrono::duration<long long>>>]: Assertion `out == expected' failed.
# `-----------------------------
# error: command failed with exit status: 250
...
# .---command stderr------------
# |
# | Format string {:L%%c='%c'%t%%Ec='%Ec'%n}
# | Expected output %c='jeu. 01 janv. 1970 00:00:00 GMT' %Ec='jeu. 01 janv. 1970 00:00:00 GMT'
# |
# | Actual output %c='jeu. 01 janv. 1970 00:00:00 UTC' %Ec='jeu. 01 janv. 1970 00:00:00 UTC'
# |
# | t.tmp.exe: /g/g92/rydahl1/LLVM_FORK/llvm-project/libcxx/test/std/time/time.syn/formatter_tests.h:41: void check(std::basic_string_view<CharT>, test_format_string<CharT, Args...>, Args &&...) [CharT = char, Args = <std::chrono::time_point<std::chrono::local_t, std::chrono::duration<long long>>>]: Assertion `out == expected' failed.
# `-----------------------------
# error: command failed with exit status: 250
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsV09v47YT_TTjy8CCRFmSdfDBsa3fb9EsWiy8BXoyKGpsMZVIg6QSu5--IK3E3m3SdoE9bSPoH8nHmUdy3kjk1sqDIlpAdgfZesIH12qzWCqn1adzw9tuUuvmvPiALX8kdK0hwvsPW3RkncU9l51UB9wb3SPksZLqgaNoSfw-FacT5DFqhcPROkO8x55L5Sv6M3Za8A57LlqpKMIPyHsclCDjPOapJdeSQdfS6EkbFLohlBafjFYHYCusBxcQwV_gYrEmwQdLoZ5ORxKOGnSyJ_xDK0Kpbmw2GpV22HMn2lCtB3ccnGdj-C1QK-QKlx_XuPnltxUWs5jhk3QtfqIG_88dbpQjczTSEt5LNZxwHs2Rq-YyLjEYQ8p1Z-_-fx-30yLCbUuBsWcXfHBDE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