Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libcxx][test] Use smaller time range for 32 bit time_t #104762

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

DavidSpickett
Copy link
Collaborator

This fixes the test on Arm 32 bit Ubuntu Jammy where time_t is 32 bit.

This fixes the test on Arm 32 bit Ubuntu Jammy where time_t is 32 bit.
@DavidSpickett DavidSpickett requested a review from a team as a code owner August 19, 2024 11:16
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Aug 19, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Aug 19, 2024

@llvm/pr-subscribers-libcxx

Author: David Spickett (DavidSpickett)

Changes

This fixes the test on Arm 32 bit Ubuntu Jammy where time_t is 32 bit.


Full diff: https://github.com/llvm/llvm-project/pull/104762.diff

1 Files Affected:

  • (modified) libcxx/test/std/time/time.zone/time.zone.timezone/time.zone.members/sys_info.zdump.pass.cpp (+1-4)
diff --git a/libcxx/test/std/time/time.zone/time.zone.timezone/time.zone.members/sys_info.zdump.pass.cpp b/libcxx/test/std/time/time.zone/time.zone.timezone/time.zone.members/sys_info.zdump.pass.cpp
index 2b97d9a5bc745b..b474fe50083b1d 100644
--- a/libcxx/test/std/time/time.zone/time.zone.timezone/time.zone.members/sys_info.zdump.pass.cpp
+++ b/libcxx/test/std/time/time.zone/time.zone.timezone/time.zone.members/sys_info.zdump.pass.cpp
@@ -13,9 +13,6 @@
 // XFAIL: libcpp-has-no-experimental-tzdb
 // XFAIL: availability-tzdb-missing
 
-// TODO TZDB Investigate
-// UNSUPPORTED: target={{armv(7|8)l-linux-gnueabihf}}
-
 #include <chrono>
 #include <format>
 #include <fstream>
@@ -28,7 +25,7 @@
 // The year range to validate. The dates used in practice are expected to be
 // inside the tested range.
 constexpr std::chrono::year first{1800};
-constexpr std::chrono::year last{2100};
+constexpr std::chrono::year last{sizeof(time_t) == 8 ? 2100 : 2037};
 
 // A custom sys_info class that also stores the name of the time zone.
 // Its formatter matches the output of zdump.

@DavidSpickett
Copy link
Collaborator Author

DavidSpickett commented Aug 19, 2024

This means that regardless of zdump's ability to handle 64 bit time_t, the test will only ever pass values in the 32 bit range.

So if there's a system out there where they are 32 bit but decided to use time_t 64 bit but the zdump is still using 32 bit time_t (risc-v perhaps?), the test will fail, but we have #103056 if that happens.

@DavidSpickett
Copy link
Collaborator Author

ping!

1 similar comment
@DavidSpickett
Copy link
Collaborator Author

ping!

@DavidSpickett DavidSpickett merged commit cdd608b into llvm:main Sep 13, 2024
57 checks passed
@DavidSpickett DavidSpickett deleted the libcxx-2037 branch September 13, 2024 08:14
ldionne pushed a commit to ldionne/llvm-project that referenced this pull request Sep 27, 2024
This fixes the test on Arm 32 bit Ubuntu Jammy where time_t is 32 bit.

(cherry picked from commit cdd608b)
tru pushed a commit to ldionne/llvm-project that referenced this pull request Oct 1, 2024
This fixes the test on Arm 32 bit Ubuntu Jammy where time_t is 32 bit.

(cherry picked from commit cdd608b)
tru pushed a commit to ldionne/llvm-project that referenced this pull request Oct 1, 2024
This fixes the test on Arm 32 bit Ubuntu Jammy where time_t is 32 bit.

(cherry picked from commit cdd608b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants