aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@bitrange.com>2024-12-29 03:32:04 +0100
committerHans-Peter Nilsson <hp@bitrange.com>2024-12-29 04:19:52 +0100
commit4da027d87eabd9a6cb0f5c1ed7ee10540501c7a3 (patch)
tree3077ab33ad12e00f1ac1dc13727f9048af7a99ca /libstdc++-v3
parentc5fd70719ada447fbdec8471eac74f8d8e8d661d (diff)
downloadgcc-4da027d87eabd9a6cb0f5c1ed7ee10540501c7a3.zip
gcc-4da027d87eabd9a6cb0f5c1ed7ee10540501c7a3.tar.gz
gcc-4da027d87eabd9a6cb0f5c1ed7ee10540501c7a3.tar.bz2
libstdc++-v3/testsuite/.../year_month_day/3.cc, 4.cc: Cut down for simulators
These two long-running tests happened to fail for me when run in parallel (nprocs - 1) compared to a serial run, for target mmix on my laptop. The runtime is 3m40s for 3.cc before this change, and 0.9s afterwards. * testsuite/std/time/year_month_day/3.cc (test01): Add ifdeffery to limit the tested dates. For simulators, pass start and end dates limiting the tested range to 100000 days, centered on days (0). * testsuite/std/time/year_month_day/4.cc: Ditto.
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/testsuite/std/time/year_month_day/3.cc11
-rw-r--r--libstdc++-v3/testsuite/std/time/year_month_day/4.cc10
2 files changed, 19 insertions, 2 deletions
diff --git a/libstdc++-v3/testsuite/std/time/year_month_day/3.cc b/libstdc++-v3/testsuite/std/time/year_month_day/3.cc
index 05dc750..f4829a6 100644
--- a/libstdc++-v3/testsuite/std/time/year_month_day/3.cc
+++ b/libstdc++-v3/testsuite/std/time/year_month_day/3.cc
@@ -1,4 +1,5 @@
// { dg-do run { target c++20 } }
+// { dg-additional-options "-DSTART_DAY=-50000 -DEND_DAY=50000 -DSTART_YMD=1833y/February/8d" { target simulator } }
// Copyright (C) 2021-2024 Free Software Foundation, Inc.
//
@@ -50,11 +51,19 @@ void test01()
{
using namespace std::chrono;
+#ifdef START_DAY
+ auto n = days{START_DAY};
+ auto ymd = START_YMD;
+ auto end_day = days{END_DAY};
+#else
// [-12687428, 11248737] maps to [-32767y/January/1d, 32767y/December/31d]
auto n = days{-12687428};
auto ymd = -32767y/January/1d;
- while (n < days{11248737}) {
+ auto end_day = days{11248737};
+#endif
+
+ while (n < end_day) {
VERIFY( year_month_day{sys_days{n}} == ymd );
++n;
advance(ymd);
diff --git a/libstdc++-v3/testsuite/std/time/year_month_day/4.cc b/libstdc++-v3/testsuite/std/time/year_month_day/4.cc
index 6b6714e..09a7551 100644
--- a/libstdc++-v3/testsuite/std/time/year_month_day/4.cc
+++ b/libstdc++-v3/testsuite/std/time/year_month_day/4.cc
@@ -1,4 +1,5 @@
// { dg-do run { target c++20 } }
+// { dg-additional-options "-DSTART_DAY=-50000 -DSTART_YMD=1833y/February/8d -DEND_YMD=2106y/November/24d" { target simulator } }
// Copyright (C) 2021-2024 Free Software Foundation, Inc.
//
@@ -50,11 +51,18 @@ void test01()
{
using namespace std::chrono;
+#ifdef START_DAY
+ auto n = days{START_DAY};
+ auto ymd = START_YMD;
+#else
// [-32767y/January/1d, 32767y/December/31d] maps to [-12687428, 11248737]
auto n = days{-12687428};
auto ymd = -32767y/January/1d;
- while (ymd < 32767y/December/31d) {
+#define END_YMD 32767y/December/31d
+#endif
+
+ while (ymd < END_YMD) {
VERIFY( static_cast<sys_days>(ymd) == sys_days{n} );
++n;
advance(ymd);