Fix some non-standard parts of our test suite. Reported by STL

llvm-svn: 267131
GitOrigin-RevId: b530a2591b3d3f2d4c6f380468d710c677fe37be
diff --git a/test/std/containers/associative/tree_balance_after_insert.pass.cpp b/test/libcxx/containers/associative/tree_balance_after_insert.pass.cpp
similarity index 100%
rename from test/std/containers/associative/tree_balance_after_insert.pass.cpp
rename to test/libcxx/containers/associative/tree_balance_after_insert.pass.cpp
diff --git a/test/std/containers/associative/tree_left_rotate.pass.cpp b/test/libcxx/containers/associative/tree_left_rotate.pass.cpp
similarity index 100%
rename from test/std/containers/associative/tree_left_rotate.pass.cpp
rename to test/libcxx/containers/associative/tree_left_rotate.pass.cpp
diff --git a/test/std/containers/associative/tree_remove.pass.cpp b/test/libcxx/containers/associative/tree_remove.pass.cpp
similarity index 100%
rename from test/std/containers/associative/tree_remove.pass.cpp
rename to test/libcxx/containers/associative/tree_remove.pass.cpp
diff --git a/test/std/containers/associative/tree_right_rotate.pass.cpp b/test/libcxx/containers/associative/tree_right_rotate.pass.cpp
similarity index 100%
rename from test/std/containers/associative/tree_right_rotate.pass.cpp
rename to test/libcxx/containers/associative/tree_right_rotate.pass.cpp
diff --git a/test/std/containers/sequences/list/list.special/db_swap_1.pass.cpp b/test/libcxx/containers/sequences/list/list.special/db_swap_1.pass.cpp
similarity index 100%
rename from test/std/containers/sequences/list/list.special/db_swap_1.pass.cpp
rename to test/libcxx/containers/sequences/list/list.special/db_swap_1.pass.cpp
diff --git a/test/std/containers/unord/next_prime.pass.cpp b/test/libcxx/containers/unord/next_prime.pass.cpp
similarity index 100%
rename from test/std/containers/unord/next_prime.pass.cpp
rename to test/libcxx/containers/unord/next_prime.pass.cpp
diff --git a/test/std/containers/unord/unord.map/db_iterators_7.pass.cpp b/test/libcxx/containers/unord/unord.map/db_iterators_7.pass.cpp
similarity index 100%
rename from test/std/containers/unord/unord.map/db_iterators_7.pass.cpp
rename to test/libcxx/containers/unord/unord.map/db_iterators_7.pass.cpp
diff --git a/test/std/containers/unord/unord.map/db_iterators_8.pass.cpp b/test/libcxx/containers/unord/unord.map/db_iterators_8.pass.cpp
similarity index 100%
rename from test/std/containers/unord/unord.map/db_iterators_8.pass.cpp
rename to test/libcxx/containers/unord/unord.map/db_iterators_8.pass.cpp
diff --git a/test/std/containers/unord/unord.map/db_local_iterators_7.pass.cpp b/test/libcxx/containers/unord/unord.map/db_local_iterators_7.pass.cpp
similarity index 100%
rename from test/std/containers/unord/unord.map/db_local_iterators_7.pass.cpp
rename to test/libcxx/containers/unord/unord.map/db_local_iterators_7.pass.cpp
diff --git a/test/std/containers/unord/unord.map/db_local_iterators_8.pass.cpp b/test/libcxx/containers/unord/unord.map/db_local_iterators_8.pass.cpp
similarity index 100%
rename from test/std/containers/unord/unord.map/db_local_iterators_8.pass.cpp
rename to test/libcxx/containers/unord/unord.map/db_local_iterators_8.pass.cpp
diff --git a/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp b/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp
index 84f04f9..53c6bd3 100644
--- a/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp
+++ b/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/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp b/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp
index 2bf2423..12af643 100644
--- a/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp
+++ b/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/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp
index a45b75d..a1c42a7 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp
+++ b/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/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp
index 0576aca..15d7400 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp
+++ b/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/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp
index eabcf2e..adc4d69 100644
--- a/test/std/containers/unord/unord.map/unord.map.modifiers/try.emplace.pass.cpp
+++ b/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/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp
index 6850115..12b2f6b 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp
+++ b/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/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
index af75fce..9606f96 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
+++ b/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/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.pass.cpp
index b661a78..01ee1ca 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.pass.cpp
+++ b/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/test/support/asan_testing.h b/test/support/asan_testing.h
index 45ad04b..b1209de 100644
--- a/test/support/asan_testing.h
+++ b/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 @@
 
 #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/test/support/constexpr_char_traits.hpp b/test/support/constexpr_char_traits.hpp
index b069c90..0a73d3a 100644
--- a/test/support/constexpr_char_traits.hpp
+++ b/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 @@
     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 @@
 }
 
 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 @@
 }
 
 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 @@
 }
 
 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 @@
 }
 
 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 @@
 }
 
 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/test/support/platform_support.h b/test/support/platform_support.h
index 233e721..1aec3cd 100644
--- a/test/support/platform_support.h
+++ b/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 @@
 }
 #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 @@
     return Name;
 #endif
 }
-#endif // _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
+#endif // __CloundABI__
 
 #endif // PLATFORM_SUPPORT_H
diff --git a/test/support/test_macros.h b/test/support/test_macros.h
index c34e8cf..09d878b 100644
--- a/test/support/test_macros.h
+++ b/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