diff options
Diffstat (limited to 'libcxx/test')
22 files changed, 45 insertions, 31 deletions
diff --git a/libcxx/test/std/containers/associative/tree_balance_after_insert.pass.cpp b/libcxx/test/libcxx/containers/associative/tree_balance_after_insert.pass.cpp index b0a3e74cab0..b0a3e74cab0 100644 --- a/libcxx/test/std/containers/associative/tree_balance_after_insert.pass.cpp +++ b/libcxx/test/libcxx/containers/associative/tree_balance_after_insert.pass.cpp diff --git a/libcxx/test/std/containers/associative/tree_left_rotate.pass.cpp b/libcxx/test/libcxx/containers/associative/tree_left_rotate.pass.cpp index 774cbc68798..774cbc68798 100644 --- a/libcxx/test/std/containers/associative/tree_left_rotate.pass.cpp +++ b/libcxx/test/libcxx/containers/associative/tree_left_rotate.pass.cpp diff --git a/libcxx/test/std/containers/associative/tree_remove.pass.cpp b/libcxx/test/libcxx/containers/associative/tree_remove.pass.cpp index fb14bd929e9..fb14bd929e9 100644 --- a/libcxx/test/std/containers/associative/tree_remove.pass.cpp +++ b/libcxx/test/libcxx/containers/associative/tree_remove.pass.cpp diff --git a/libcxx/test/std/containers/associative/tree_right_rotate.pass.cpp b/libcxx/test/libcxx/containers/associative/tree_right_rotate.pass.cpp index 06ec7b88945..06ec7b88945 100644 --- a/libcxx/test/std/containers/associative/tree_right_rotate.pass.cpp +++ b/libcxx/test/libcxx/containers/associative/tree_right_rotate.pass.cpp diff --git a/libcxx/test/std/containers/sequences/list/list.special/db_swap_1.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.special/db_swap_1.pass.cpp index f7171795cd5..f7171795cd5 100644 --- a/libcxx/test/std/containers/sequences/list/list.special/db_swap_1.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/list/list.special/db_swap_1.pass.cpp diff --git a/libcxx/test/std/containers/unord/next_prime.pass.cpp b/libcxx/test/libcxx/containers/unord/next_prime.pass.cpp index 266d7f1f9d1..266d7f1f9d1 100644 --- a/libcxx/test/std/containers/unord/next_prime.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/next_prime.pass.cpp diff --git a/libcxx/test/std/containers/unord/unord.map/db_iterators_7.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_7.pass.cpp index b8db0a35ffc..b8db0a35ffc 100644 --- a/libcxx/test/std/containers/unord/unord.map/db_iterators_7.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_7.pass.cpp diff --git a/libcxx/test/std/containers/unord/unord.map/db_iterators_8.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_8.pass.cpp index c923dd77862..c923dd77862 100644 --- a/libcxx/test/std/containers/unord/unord.map/db_iterators_8.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_8.pass.cpp diff --git a/libcxx/test/std/containers/unord/unord.map/db_local_iterators_7.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_7.pass.cpp index fa1886bfff1..fa1886bfff1 100644 --- a/libcxx/test/std/containers/unord/unord.map/db_local_iterators_7.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_7.pass.cpp diff --git a/libcxx/test/std/containers/unord/unord.map/db_local_iterators_8.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_8.pass.cpp index 4b071cad7b4..4b071cad7b4 100644 --- a/libcxx/test/std/containers/unord/unord.map/db_local_iterators_8.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_8.pass.cpp diff --git a/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp index 84f04f9d52d..53c6bd3380a 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp @@ -12,6 +12,8 @@ // void resize(size_type n); #include <deque> +#include <algorithm> +#include <iterator> #include <cassert> #include "test_macros.h" diff --git a/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp index 2bf2423fb9a..12af64386bd 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp @@ -12,6 +12,8 @@ // void resize(size_type n, const value_type& v); #include <deque> +#include <algorithm> +#include <iterator> #include <cassert> #include "test_macros.h" diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp index a45b75d25c9..a1c42a71dff 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp @@ -12,6 +12,8 @@ // iterator erase(const_iterator p) #include <deque> +#include <algorithm> +#include <iterator> #include <cassert> #include "min_allocator.h" diff --git a/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp b/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp index 0576aca5c1a..15d7400b869 100644 --- a/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp +++ b/libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp @@ -14,6 +14,8 @@ // iterator erase(const_iterator f, const_iterator l) #include <deque> +#include <algorithm> +#include <iterator> #include <cassert> #include "min_allocator.h" diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp index eabcf2e85db..adc4d6944ec 100644 --- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp +++ b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp @@ -22,7 +22,6 @@ // template <class... Args> // iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args); // C++17 -#include <__config> #include <unordered_map> #include <cassert> #include <tuple> diff --git a/libcxx/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp b/libcxx/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp index 6850115875b..12b2f6b6485 100644 --- a/libcxx/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp +++ b/libcxx/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp @@ -17,6 +17,7 @@ // template<class _URNG> result_type operator()(_URNG& g, const param_type& parm); #include <random> +#include <algorithm> #include <vector> #include <iterator> #include <numeric> diff --git a/libcxx/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp b/libcxx/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp index af75fce512e..9606f96f911 100644 --- a/libcxx/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp +++ b/libcxx/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp @@ -19,6 +19,7 @@ #include <iostream> #include <random> +#include <algorithm> #include <vector> #include <iterator> #include <numeric> diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.pass.cpp index b661a78de8d..01ee1ca1f43 100644 --- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.pass.cpp +++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.pass.cpp @@ -11,6 +11,7 @@ #include <tuple> #include <utility> +#include <memory> #include <string> #include <complex> #include <type_traits> diff --git a/libcxx/test/support/asan_testing.h b/libcxx/test/support/asan_testing.h index 45ad04b1bb2..b1209de2313 100644 --- a/libcxx/test/support/asan_testing.h +++ b/libcxx/test/support/asan_testing.h @@ -10,9 +10,9 @@ #ifndef ASAN_TESTING_H #define ASAN_TESTING_H -#include <__config> +#include "test_macros.h" -#ifndef _LIBCPP_HAS_NO_ASAN +#if TEST_HAS_FEATURE(address_sanitizer) extern "C" int __sanitizer_verify_contiguous_container ( const void *beg, const void *mid, const void *end ); @@ -27,7 +27,7 @@ bool is_contiguous_container_asan_correct ( const std::vector<T, Alloc> &c ) #else template <typename T, typename Alloc> -bool is_contiguous_container_asan_correct ( const std::vector<T, Alloc> &c ) +bool is_contiguous_container_asan_correct ( const std::vector<T, Alloc> &) { return true; } diff --git a/libcxx/test/support/constexpr_char_traits.hpp b/libcxx/test/support/constexpr_char_traits.hpp index b069c90076a..0a73d3ad1ea 100644 --- a/libcxx/test/support/constexpr_char_traits.hpp +++ b/libcxx/test/support/constexpr_char_traits.hpp @@ -11,9 +11,9 @@ #ifndef _CONSTEXPR_CHAR_TRAITS #define _CONSTEXPR_CHAR_TRAITS -#include <__config> #include <string> +#include "test_macros.h" template <class _CharT> struct constexpr_char_traits @@ -24,41 +24,41 @@ struct constexpr_char_traits typedef std::streampos pos_type; typedef std::mbstate_t state_type; - static _LIBCPP_CONSTEXPR_AFTER_CXX11 void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT + static TEST_CONSTEXPR_CXX14 void assign(char_type& __c1, const char_type& __c2) TEST_NOEXCEPT {__c1 = __c2;} - static _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT + static TEST_CONSTEXPR bool eq(char_type __c1, char_type __c2) TEST_NOEXCEPT {return __c1 == __c2;} - static _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT + static TEST_CONSTEXPR bool lt(char_type __c1, char_type __c2) TEST_NOEXCEPT {return __c1 < __c2;} - static _LIBCPP_CONSTEXPR_AFTER_CXX11 int compare(const char_type* __s1, const char_type* __s2, size_t __n); - static _LIBCPP_CONSTEXPR_AFTER_CXX11 size_t length(const char_type* __s); - static _LIBCPP_CONSTEXPR_AFTER_CXX11 const char_type* find(const char_type* __s, size_t __n, const char_type& __a); - static _LIBCPP_CONSTEXPR_AFTER_CXX11 char_type* move(char_type* __s1, const char_type* __s2, size_t __n); - static _LIBCPP_CONSTEXPR_AFTER_CXX11 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n); - static _LIBCPP_CONSTEXPR_AFTER_CXX11 char_type* assign(char_type* __s, size_t __n, char_type __a); + static TEST_CONSTEXPR_CXX14 int compare(const char_type* __s1, const char_type* __s2, size_t __n); + static TEST_CONSTEXPR_CXX14 size_t length(const char_type* __s); + static TEST_CONSTEXPR_CXX14 const char_type* find(const char_type* __s, size_t __n, const char_type& __a); + static TEST_CONSTEXPR_CXX14 char_type* move(char_type* __s1, const char_type* __s2, size_t __n); + static TEST_CONSTEXPR_CXX14 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n); + static TEST_CONSTEXPR_CXX14 char_type* assign(char_type* __s, size_t __n, char_type __a); - static _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT + static TEST_CONSTEXPR int_type not_eof(int_type __c) TEST_NOEXCEPT {return eq_int_type(__c, eof()) ? ~eof() : __c;} - static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT + static TEST_CONSTEXPR char_type to_char_type(int_type __c) TEST_NOEXCEPT {return char_type(__c);} - static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT + static TEST_CONSTEXPR int_type to_int_type(char_type __c) TEST_NOEXCEPT {return int_type(__c);} - static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT + static TEST_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) TEST_NOEXCEPT {return __c1 == __c2;} - static _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT + static TEST_CONSTEXPR int_type eof() TEST_NOEXCEPT {return int_type(EOF);} }; template <class _CharT> -_LIBCPP_CONSTEXPR_AFTER_CXX11 int +TEST_CONSTEXPR_CXX14 int constexpr_char_traits<_CharT>::compare(const char_type* __s1, const char_type* __s2, size_t __n) { for (; __n; --__n, ++__s1, ++__s2) @@ -72,7 +72,7 @@ constexpr_char_traits<_CharT>::compare(const char_type* __s1, const char_type* _ } template <class _CharT> -_LIBCPP_CONSTEXPR_AFTER_CXX11 size_t +TEST_CONSTEXPR_CXX14 size_t constexpr_char_traits<_CharT>::length(const char_type* __s) { size_t __len = 0; @@ -82,7 +82,7 @@ constexpr_char_traits<_CharT>::length(const char_type* __s) } template <class _CharT> -_LIBCPP_CONSTEXPR_AFTER_CXX11 const _CharT* +TEST_CONSTEXPR_CXX14 const _CharT* constexpr_char_traits<_CharT>::find(const char_type* __s, size_t __n, const char_type& __a) { for (; __n; --__n) @@ -95,7 +95,7 @@ constexpr_char_traits<_CharT>::find(const char_type* __s, size_t __n, const char } template <class _CharT> -_LIBCPP_CONSTEXPR_AFTER_CXX11 _CharT* +TEST_CONSTEXPR_CXX14 _CharT* constexpr_char_traits<_CharT>::move(char_type* __s1, const char_type* __s2, size_t __n) { char_type* __r = __s1; @@ -115,7 +115,7 @@ constexpr_char_traits<_CharT>::move(char_type* __s1, const char_type* __s2, size } template <class _CharT> -_LIBCPP_CONSTEXPR_AFTER_CXX11 _CharT* +TEST_CONSTEXPR_CXX14 _CharT* constexpr_char_traits<_CharT>::copy(char_type* __s1, const char_type* __s2, size_t __n) { _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); @@ -126,7 +126,7 @@ constexpr_char_traits<_CharT>::copy(char_type* __s1, const char_type* __s2, size } template <class _CharT> -_LIBCPP_CONSTEXPR_AFTER_CXX11 _CharT* +TEST_CONSTEXPR_CXX14 _CharT* constexpr_char_traits<_CharT>::assign(char_type* __s, size_t __n, char_type __a) { char_type* __r = __s; diff --git a/libcxx/test/support/platform_support.h b/libcxx/test/support/platform_support.h index 233e721ff51..1aec3cdae6d 100644 --- a/libcxx/test/support/platform_support.h +++ b/libcxx/test/support/platform_support.h @@ -15,8 +15,6 @@ #ifndef PLATFORM_SUPPORT_H #define PLATFORM_SUPPORT_H -#include <__config> - // locale names #ifdef _WIN32 // WARNING: Windows does not support UTF-8 codepages. @@ -54,7 +52,7 @@ #include <stdio.h> #include <stdlib.h> #include <string> -#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__) +#if defined(_WIN32) || defined(__MINGW32__) #include <io.h> // _mktemp #else #include <unistd.h> // close @@ -67,12 +65,12 @@ extern "C" { } #endif -#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE +#ifndef __CloudABI__ inline std::string get_temp_file_name() { -#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__) +#if defined(_WIN32) || defined(__MINGW32__) char Path[MAX_PATH+1]; char FN[MAX_PATH+1]; do { } while (0 == GetTempPath(MAX_PATH+1, Path)); @@ -93,6 +91,6 @@ get_temp_file_name() return Name; #endif } -#endif // _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE +#endif // __CloundABI__ #endif // PLATFORM_SUPPORT_H diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h index c34e8cf7ef1..09d878b143c 100644 --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -70,8 +70,14 @@ #if TEST_STD_VER >= 11 #define TEST_CONSTEXPR constexpr #define TEST_NOEXCEPT noexcept +# if TEST_STD_VER >= 14 +# define TEST_CONSTEXPR_CXX14 constexpr +# else +# define TEST_CONSTEXPR_CXX14 +# endif #else #define TEST_CONSTEXPR +#define TEST_CONSTEXPR_CXX14 #define TEST_NOEXCEPT #endif |