diff options
Diffstat (limited to 'test/std/language.support')
3 files changed, 66 insertions, 0 deletions
diff --git a/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp b/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp index 5f63af68f701..6e399d0934bf 100644 --- a/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp +++ b/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp @@ -23,6 +23,20 @@ #error FLT_RADIX not defined #endif +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#ifndef FLT_HAS_SUBNORM +#error FLT_HAS_SUBNORM not defined +#endif + +#ifndef DBL_HAS_SUBNORM +#error DBL_HAS_SUBNORM not defined +#endif + +#ifndef LDBL_HAS_SUBNORM +#error LDBL_HAS_SUBNORM not defined +#endif +#endif + #ifndef FLT_MANT_DIG #error FLT_MANT_DIG not defined #endif @@ -39,6 +53,20 @@ #error DECIMAL_DIG not defined #endif +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#ifndef FLT_DECIMAL_DIG +#error FLT_DECIMAL_DIG not defined +#endif + +#ifndef DBL_DECIMAL_DIG +#error DBL_DECIMAL_DIG not defined +#endif + +#ifndef LDBL_DECIMAL_DIG +#error LDBL_DECIMAL_DIG not defined +#endif +#endif + #ifndef FLT_DIG #error FLT_DIG not defined #endif @@ -135,6 +163,20 @@ #error LDBL_MIN not defined #endif +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#ifndef FLT_TRUE_MIN +#error FLT_TRUE_MIN not defined +#endif + +#ifndef DBL_TRUE_MIN +#error DBL_TRUE_MIN not defined +#endif + +#ifndef LDBL_TRUE_MIN +#error LDBL_TRUE_MIN not defined +#endif +#endif + int main() { } 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), ""); |