about summary refs log tree commit diff
path: root/time
diff options
context:
space:
mode:
Diffstat (limited to 'time')
-rw-r--r--time/Makefile18
-rw-r--r--time/tst-adjtime-time64.c1
-rw-r--r--time/tst-clock-time64.c1
-rw-r--r--time/tst-clock2-time64.c1
-rw-r--r--time/tst-clock_nanosleep-time64.c1
-rw-r--r--time/tst-clock_settime-time64.c1
-rw-r--r--time/tst-cpuclock1-time64.c1
-rw-r--r--time/tst-ctime-time64.c1
-rw-r--r--time/tst-ctime.c16
-rw-r--r--time/tst-difftime-time64.c1
-rw-r--r--time/tst-gmtime-time64.c1
-rw-r--r--time/tst-itimer-time64.c1
-rw-r--r--time/tst-mktime4-time64.c1
-rw-r--r--time/tst-settimeofday-time64.c1
-rw-r--r--time/tst-timegm-time64.c1
-rw-r--r--time/tst-timespec_get-time64.c1
-rw-r--r--time/tst-timespec_getres-time64.c1
-rw-r--r--time/tst-y2039-time64.c1
-rw-r--r--time/tst-y2039.c10
19 files changed, 60 insertions, 0 deletions
diff --git a/time/Makefile b/time/Makefile
index 805c79c4d0..c84bd5d3ec 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -52,6 +52,24 @@ tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
 	   tst-settimeofday tst-itimer tst-gmtime tst-timegm \
 	   tst-timespec_get tst-timespec_getres
 
+tests-time64 := \
+  tst-adjtime-time64 \
+  tst-clock-time64 \
+  tst-clock2-time64 \
+  tst-clock_nanosleep-time64 \
+  tst-clock_settime-time64 \
+  tst-cpuclock1-time64 \
+  tst-ctime-time64 \
+  tst-difftime-time64 \
+  tst-gmtime-time64 \
+  tst-itimer-time64 \
+  tst-mktime4-time64 \
+  tst-settimeofday-time64 \
+  tst-timegm-time64 \
+  tst-timespec_get-time64 \
+  tst-timespec_getres-time64 \
+  tst-y2039-time64
+
 include ../Rules
 
 ifeq ($(run-built-tests),yes)
diff --git a/time/tst-adjtime-time64.c b/time/tst-adjtime-time64.c
new file mode 100644
index 0000000000..097d6efc4b
--- /dev/null
+++ b/time/tst-adjtime-time64.c
@@ -0,0 +1 @@
+#include <tst-adjtime.c>
diff --git a/time/tst-clock-time64.c b/time/tst-clock-time64.c
new file mode 100644
index 0000000000..a1349678c8
--- /dev/null
+++ b/time/tst-clock-time64.c
@@ -0,0 +1 @@
+#include "tst-clock.c"
diff --git a/time/tst-clock2-time64.c b/time/tst-clock2-time64.c
new file mode 100644
index 0000000000..897f47b287
--- /dev/null
+++ b/time/tst-clock2-time64.c
@@ -0,0 +1 @@
+#include "tst-clock2.c"
diff --git a/time/tst-clock_nanosleep-time64.c b/time/tst-clock_nanosleep-time64.c
new file mode 100644
index 0000000000..c8638aa3d2
--- /dev/null
+++ b/time/tst-clock_nanosleep-time64.c
@@ -0,0 +1 @@
+#include "tst-clock_nanosleep.c"
diff --git a/time/tst-clock_settime-time64.c b/time/tst-clock_settime-time64.c
new file mode 100644
index 0000000000..328b04a030
--- /dev/null
+++ b/time/tst-clock_settime-time64.c
@@ -0,0 +1 @@
+#include <tst-clock_settime.c>
diff --git a/time/tst-cpuclock1-time64.c b/time/tst-cpuclock1-time64.c
new file mode 100644
index 0000000000..5a7ffa27ac
--- /dev/null
+++ b/time/tst-cpuclock1-time64.c
@@ -0,0 +1 @@
+#include "tst-cpuclock1.c"
diff --git a/time/tst-ctime-time64.c b/time/tst-ctime-time64.c
new file mode 100644
index 0000000000..24a5ae98ed
--- /dev/null
+++ b/time/tst-ctime-time64.c
@@ -0,0 +1 @@
+#include "tst-ctime.c"
diff --git a/time/tst-ctime.c b/time/tst-ctime.c
index e89a906bf8..884d69bfa0 100644
--- a/time/tst-ctime.c
+++ b/time/tst-ctime.c
@@ -24,6 +24,7 @@ static int
 do_test (void)
 {
   char *str;
+  char strb[32];
   time_t t;
 
   /* Use glibc time zone extension "TZ=:" to to guarantee that UTC
@@ -36,11 +37,21 @@ do_test (void)
   str = ctime (&t);
   TEST_COMPARE_STRING (str, "Thu Jan  1 00:00:00 1970\n");
 
+  /* Same as before but with ctime_r.  */
+  str = ctime_r (&t, strb);
+  TEST_VERIFY (str == strb);
+  TEST_COMPARE_STRING (str, "Thu Jan  1 00:00:00 1970\n");
+
   /* Check if the max time value for 32 bit time_t can be converted.  */
   t = 0x7fffffff;
   str = ctime (&t);
   TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:07 2038\n");
 
+  /* Same as before but with ctime_r.  */
+  str = ctime_r (&t, strb);
+  TEST_VERIFY (str == strb);
+  TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:07 2038\n");
+
   /* Check if we run on port with 32 bit time_t size */
   time_t tov;
   if (__builtin_add_overflow (t, 1, &tov))
@@ -50,6 +61,11 @@ do_test (void)
   str = ctime (&tov);
   TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:08 2038\n");
 
+  /* Same as before but with ctime_r.  */
+  str = ctime_r (&tov, strb);
+  TEST_VERIFY (str == strb);
+  TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:08 2038\n");
+
   return 0;
 }
 
diff --git a/time/tst-difftime-time64.c b/time/tst-difftime-time64.c
new file mode 100644
index 0000000000..751ce6c483
--- /dev/null
+++ b/time/tst-difftime-time64.c
@@ -0,0 +1 @@
+#include "tst-difftime.c"
diff --git a/time/tst-gmtime-time64.c b/time/tst-gmtime-time64.c
new file mode 100644
index 0000000000..0df11c1913
--- /dev/null
+++ b/time/tst-gmtime-time64.c
@@ -0,0 +1 @@
+#include "tst-gmtime.c"
diff --git a/time/tst-itimer-time64.c b/time/tst-itimer-time64.c
new file mode 100644
index 0000000000..ddd2efa175
--- /dev/null
+++ b/time/tst-itimer-time64.c
@@ -0,0 +1 @@
+#include <time/tst-itimer.c>
diff --git a/time/tst-mktime4-time64.c b/time/tst-mktime4-time64.c
new file mode 100644
index 0000000000..bf5197c6f3
--- /dev/null
+++ b/time/tst-mktime4-time64.c
@@ -0,0 +1 @@
+#include "tst-mktime4.c"
diff --git a/time/tst-settimeofday-time64.c b/time/tst-settimeofday-time64.c
new file mode 100644
index 0000000000..185d167a22
--- /dev/null
+++ b/time/tst-settimeofday-time64.c
@@ -0,0 +1 @@
+#include <tst-settimeofday.c>
diff --git a/time/tst-timegm-time64.c b/time/tst-timegm-time64.c
new file mode 100644
index 0000000000..8e3084f74e
--- /dev/null
+++ b/time/tst-timegm-time64.c
@@ -0,0 +1 @@
+#include "tst-timegm.c"
diff --git a/time/tst-timespec_get-time64.c b/time/tst-timespec_get-time64.c
new file mode 100644
index 0000000000..48f336385d
--- /dev/null
+++ b/time/tst-timespec_get-time64.c
@@ -0,0 +1 @@
+#include "tst-timespec_get.c"
diff --git a/time/tst-timespec_getres-time64.c b/time/tst-timespec_getres-time64.c
new file mode 100644
index 0000000000..59a0f36103
--- /dev/null
+++ b/time/tst-timespec_getres-time64.c
@@ -0,0 +1 @@
+#include "tst-timespec_getres.c"
diff --git a/time/tst-y2039-time64.c b/time/tst-y2039-time64.c
new file mode 100644
index 0000000000..3c8a504186
--- /dev/null
+++ b/time/tst-y2039-time64.c
@@ -0,0 +1 @@
+#include "tst-y2039.c"
diff --git a/time/tst-y2039.c b/time/tst-y2039.c
index ef024c0a77..66a22d4c2c 100644
--- a/time/tst-y2039.c
+++ b/time/tst-y2039.c
@@ -37,6 +37,16 @@ do_test (void)
 			> 0);
       puts (buf);
       TEST_VERIFY (strcmp (buf, "2039-04-30 14:00:00 PDT") == 0);
+
+      /* Same as before but for localtime_r.  */
+      struct tm tmd;
+      tm = localtime_r (&ouch, &tmd);
+      TEST_VERIFY_EXIT (tm == &tmd);
+
+      TEST_VERIFY_EXIT (strftime (buf, sizeof buf, "%Y-%m-%d %H:%M:%S %Z", tm)
+			> 0);
+      puts (buf);
+      TEST_VERIFY (strcmp (buf, "2039-04-30 14:00:00 PDT") == 0);
     }
   else
     FAIL_UNSUPPORTED ("32-bit time_t");