aboutsummaryrefslogtreecommitdiff
path: root/test/std/language.support/support.runtime
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/language.support/support.runtime')
-rw-r--r--test/std/language.support/support.runtime/cstdlib.pass.cpp10
-rw-r--r--test/std/language.support/support.runtime/ctime.pass.cpp14
2 files changed, 24 insertions, 0 deletions
diff --git a/test/std/language.support/support.runtime/cstdlib.pass.cpp b/test/std/language.support/support.runtime/cstdlib.pass.cpp
index 60f7d954db54..e9dda6cee4ee 100644
--- a/test/std/language.support/support.runtime/cstdlib.pass.cpp
+++ b/test/std/language.support/support.runtime/cstdlib.pass.cpp
@@ -13,6 +13,8 @@
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
// As of 1/10/2015 clang emits a -Wnonnull warnings even if the warning occurs
// in an unevaluated context. For this reason we manually suppress the warning.
#if defined(__clang__)
@@ -71,6 +73,14 @@ int main()
static_assert((std::is_same<decltype(std::strtoull("", endptr,0)), unsigned long long>::value), "");
static_assert((std::is_same<decltype(std::rand()), int>::value), "");
static_assert((std::is_same<decltype(std::srand(0)), void>::value), "");
+
+// Microsoft does not implement aligned_alloc in their C library
+#ifndef TEST_COMPILER_C1XX
+#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES)
+ static_assert((std::is_same<decltype(std::aligned_alloc(0,0)), void*>::value), "");
+#endif
+#endif
+
static_assert((std::is_same<decltype(std::calloc(0,0)), void*>::value), "");
static_assert((std::is_same<decltype(std::free(0)), void>::value), "");
static_assert((std::is_same<decltype(std::malloc(0)), void*>::value), "");
diff --git a/test/std/language.support/support.runtime/ctime.pass.cpp b/test/std/language.support/support.runtime/ctime.pass.cpp
index 34343b247f21..908dc480884c 100644
--- a/test/std/language.support/support.runtime/ctime.pass.cpp
+++ b/test/std/language.support/support.runtime/ctime.pass.cpp
@@ -11,6 +11,7 @@
#include <ctime>
#include <type_traits>
+#include "test_macros.h"
#ifndef NULL
#error NULL not defined
@@ -20,12 +21,22 @@
#error CLOCKS_PER_SEC not defined
#endif
+#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES)
+#ifndef TIME_UTC
+#error TIME_UTC not defined
+#endif
+#endif
+
int main()
{
std::clock_t c = 0;
std::size_t s = 0;
std::time_t t = 0;
std::tm tm = {};
+#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES)
+ std::timespec tmspec = {};
+ ((void)tmspec); // Prevent unused warning
+#endif
((void)c); // Prevent unused warning
((void)s); // Prevent unused warning
((void)t); // Prevent unused warning
@@ -34,6 +45,9 @@ int main()
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), "");
+#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES)
+ static_assert((std::is_same<decltype(std::timespec_get(nullptr, 0)), int>::value), "");
+#endif
#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), "");