summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/time
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2015-08-24 21:27:25 +0000
committerEric Fiselier <eric@efcs.ca>2015-08-24 21:27:25 +0000
commitb76b5b255df9a2ed28e1e3871bb95dc217fb800f (patch)
tree7fdad6709224e775cb32906813e553ac077eee2c /libcxx/test/std/utilities/time
parent91b3a5e7c5f13010b258d39dcfc77b22b0846d47 (diff)
downloadbcm5719-llvm-b76b5b255df9a2ed28e1e3871bb95dc217fb800f.tar.gz
bcm5719-llvm-b76b5b255df9a2ed28e1e3871bb95dc217fb800f.zip
Move test/std/utilities/date.time to proper stable name utilities/time/date.time
llvm-svn: 245877
Diffstat (limited to 'libcxx/test/std/utilities/time')
-rw-r--r--libcxx/test/std/utilities/time/date.time/ctime.pass.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/libcxx/test/std/utilities/time/date.time/ctime.pass.cpp b/libcxx/test/std/utilities/time/date.time/ctime.pass.cpp
new file mode 100644
index 00000000000..d0a838e0c27
--- /dev/null
+++ b/libcxx/test/std/utilities/time/date.time/ctime.pass.cpp
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <ctime>
+#include <type_traits>
+
+#ifndef NULL
+#error NULL not defined
+#endif
+
+#ifndef CLOCKS_PER_SEC
+#error CLOCKS_PER_SEC not defined
+#endif
+
+int main()
+{
+ std::clock_t c = 0;
+ ((void)c); // avoid unused warning
+ std::size_t s = 0;
+ std::time_t t = 0;
+ std::tm tm = {0};
+ char str[3];
+ static_assert((std::is_same<decltype(std::clock()), std::clock_t>::value), "");
+ static_assert((std::is_same<decltype(std::difftime(t,t)), double>::value), "");
+ static_assert((std::is_same<decltype(std::mktime(&tm)), std::time_t>::value), "");
+ static_assert((std::is_same<decltype(std::time(&t)), std::time_t>::value), "");
+#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
+ static_assert((std::is_same<decltype(std::asctime(&tm)), char*>::value), "");
+ static_assert((std::is_same<decltype(std::ctime(&t)), char*>::value), "");
+ static_assert((std::is_same<decltype(std::gmtime(&t)), std::tm*>::value), "");
+ static_assert((std::is_same<decltype(std::localtime(&t)), std::tm*>::value), "");
+#endif
+ static_assert((std::is_same<decltype(std::strftime(str,s,"",&tm)), std::size_t>::value), "");
+}
OpenPOWER on IntegriCloud