diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2018-07-31 23:39:12 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2018-07-31 23:39:12 +0000 |
commit | 1f9e03f04d4fd0f9c76bded4ad0e43fc80e480fa (patch) | |
tree | 36247312ac0df6476a6c04532590d726007e0de4 /libcxx/test | |
parent | 89e8af6d9616ee01b7a669162b0094230d62d701 (diff) | |
download | bcm5719-llvm-1f9e03f04d4fd0f9c76bded4ad0e43fc80e480fa.tar.gz bcm5719-llvm-1f9e03f04d4fd0f9c76bded4ad0e43fc80e480fa.zip |
Final bit of P0063 - make sure that aligned_alloc is available when the underlying C library supports it
llvm-svn: 338457
Diffstat (limited to 'libcxx/test')
-rw-r--r-- | libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp | 10 | ||||
-rw-r--r-- | libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp index 1680f4349bb..07ffa0b7551 100644 --- a/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp +++ b/libcxx/test/std/depr/depr.c.headers/stdlib_h.pass.cpp @@ -12,6 +12,8 @@ #include <stdlib.h> #include <type_traits> +#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__) @@ -83,6 +85,14 @@ int main() static_assert((std::is_same<decltype(strtoull("", endptr,0)), unsigned long long>::value), ""); static_assert((std::is_same<decltype(rand()), int>::value), ""); static_assert((std::is_same<decltype(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(aligned_alloc(0,0)), void*>::value), ""); +#endif +#endif + static_assert((std::is_same<decltype(calloc(0,0)), void*>::value), ""); static_assert((std::is_same<decltype(free(0)), void>::value), ""); static_assert((std::is_same<decltype(malloc(0)), void*>::value), ""); diff --git a/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp b/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp index 60f7d954db5..e9dda6cee4e 100644 --- a/libcxx/test/std/language.support/support.runtime/cstdlib.pass.cpp +++ b/libcxx/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), ""); |