From e58baed3a38790e5cb26abf6a595735f9c784084 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Sat, 8 Oct 2016 01:25:23 +0000 Subject: Purge all usages of _LIBCPP_STD_VER under test/std/algorithm llvm-svn: 283643 --- libcxx/test/std/algorithms/alg.sorting/alg.min.max/max.pass.cpp | 4 +++- .../std/algorithms/alg.sorting/alg.min.max/max_comp.pass.cpp | 4 +++- .../algorithms/alg.sorting/alg.min.max/max_init_list.pass.cpp | 8 +++++--- .../alg.sorting/alg.min.max/max_init_list_comp.pass.cpp | 8 +++++--- libcxx/test/std/algorithms/alg.sorting/alg.min.max/min.pass.cpp | 4 +++- .../std/algorithms/alg.sorting/alg.min.max/min_comp.pass.cpp | 4 +++- .../algorithms/alg.sorting/alg.min.max/min_init_list.pass.cpp | 8 +++++--- .../alg.sorting/alg.min.max/min_init_list_comp.pass.cpp | 8 +++++--- .../test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp | 4 +++- .../std/algorithms/alg.sorting/alg.min.max/minmax_comp.pass.cpp | 4 +++- .../algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp | 8 +++++--- .../alg.sorting/alg.min.max/minmax_init_list_comp.pass.cpp | 9 ++++----- 12 files changed, 47 insertions(+), 26 deletions(-) (limited to 'libcxx/test/std/algorithms/alg.sorting') diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max.pass.cpp index c560c22f2d7..f453a234d2e 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max.pass.cpp @@ -16,6 +16,8 @@ #include #include +#include "test_macros.h" + template void test(const T& a, const T& b, const T& x) @@ -43,7 +45,7 @@ int main() test(x, y, x); test(y, x, x); } -#if _LIBCPP_STD_VER > 11 +#if TEST_STD_VER >= 14 { constexpr int x = 1; constexpr int y = 0; diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_comp.pass.cpp index 95241af5006..6c185c2a803 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_comp.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_comp.pass.cpp @@ -18,6 +18,8 @@ #include #include +#include "test_macros.h" + template void test(const T& a, const T& b, C c, const T& x) @@ -45,7 +47,7 @@ int main() test(x, y, std::greater(), y); test(y, x, std::greater(), y); } -#if _LIBCPP_STD_VER > 11 +#if TEST_STD_VER >= 14 { constexpr int x = 1; constexpr int y = 0; diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_init_list.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_init_list.pass.cpp index 0438412d236..e003acaa5aa 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_init_list.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_init_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // template @@ -16,9 +18,10 @@ #include #include +#include "test_macros.h" + int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS int i = std::max({2, 3, 1}); assert(i == 3); i = std::max({2, 1, 3}); @@ -31,12 +34,11 @@ int main() assert(i == 3); i = std::max({1, 3, 2}); assert(i == 3); -#if _LIBCPP_STD_VER > 11 +#if TEST_STD_VER >= 14 { static_assert(std::max({1, 3, 2}) == 3, ""); static_assert(std::max({2, 1, 3}) == 3, ""); static_assert(std::max({3, 2, 1}) == 3, ""); } #endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_init_list_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_init_list_comp.pass.cpp index 4dd47a73ef3..6b3c72b1de9 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_init_list_comp.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_init_list_comp.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // template @@ -17,9 +19,10 @@ #include #include +#include "test_macros.h" + int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS int i = std::max({2, 3, 1}, std::greater()); assert(i == 1); i = std::max({2, 1, 3}, std::greater()); @@ -32,12 +35,11 @@ int main() assert(i == 1); i = std::max({1, 3, 2}, std::greater()); assert(i == 1); -#if _LIBCPP_STD_VER > 11 +#if TEST_STD_VER >= 14 { static_assert(std::max({1, 3, 2}, std::greater()) == 1, ""); static_assert(std::max({2, 1, 3}, std::greater()) == 1, ""); static_assert(std::max({3, 2, 1}, std::greater()) == 1, ""); } #endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min.pass.cpp index bbbd97bc5a4..3d0241f80db 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min.pass.cpp @@ -16,6 +16,8 @@ #include #include +#include "test_macros.h" + template void test(const T& a, const T& b, const T& x) @@ -43,7 +45,7 @@ int main() test(x, y, y); test(y, x, y); } -#if _LIBCPP_STD_VER > 11 +#if TEST_STD_VER >= 14 { constexpr int x = 1; constexpr int y = 0; diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_comp.pass.cpp index 4ef705e7771..9dc74380261 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_comp.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_comp.pass.cpp @@ -18,6 +18,8 @@ #include #include +#include "test_macros.h" + template void test(const T& a, const T& b, C c, const T& x) @@ -45,7 +47,7 @@ int main() test(x, y, std::greater(), x); test(y, x, std::greater(), x); } -#if _LIBCPP_STD_VER > 11 +#if TEST_STD_VER >= 14 { constexpr int x = 1; constexpr int y = 0; diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_init_list.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_init_list.pass.cpp index eed4ebd4575..d212bf6cfe8 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_init_list.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_init_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // template @@ -16,9 +18,10 @@ #include #include +#include "test_macros.h" + int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS int i = std::min({2, 3, 1}); assert(i == 1); i = std::min({2, 1, 3}); @@ -31,12 +34,11 @@ int main() assert(i == 1); i = std::min({1, 3, 2}); assert(i == 1); -#if _LIBCPP_STD_VER > 11 +#if TEST_STD_VER >= 14 { static_assert(std::min({1, 3, 2}) == 1, ""); static_assert(std::min({2, 1, 3}) == 1, ""); static_assert(std::min({3, 2, 1}) == 1, ""); } #endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_init_list_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_init_list_comp.pass.cpp index 5e0301b657b..7435da1661a 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_init_list_comp.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_init_list_comp.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // template @@ -17,9 +19,10 @@ #include #include +#include "test_macros.h" + int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS int i = std::min({2, 3, 1}, std::greater()); assert(i == 3); i = std::min({2, 1, 3}, std::greater()); @@ -32,12 +35,11 @@ int main() assert(i == 3); i = std::min({1, 3, 2}, std::greater()); assert(i == 3); -#if _LIBCPP_STD_VER > 11 +#if TEST_STD_VER >= 14 { static_assert(std::min({1, 3, 2}, std::greater()) == 3, ""); static_assert(std::min({2, 1, 3}, std::greater()) == 3, ""); static_assert(std::min({3, 2, 1}, std::greater()) == 3, ""); } #endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp index 8276c3a5dfd..6ef4d06467b 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp @@ -16,6 +16,8 @@ #include #include +#include "test_macros.h" + template void test(const T& a, const T& b, const T& x, const T& y) @@ -45,7 +47,7 @@ int main() test(x, y, y, x); test(y, x, y, x); } -#if _LIBCPP_STD_VER > 11 +#if TEST_STD_VER >= 14 { // Note that you can't take a reference to a local var, since // its address is not a compile-time constant. diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_comp.pass.cpp index 3289f8a7582..a2027d440c4 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_comp.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_comp.pass.cpp @@ -18,6 +18,8 @@ #include #include +#include "test_macros.h" + template void test(const T& a, const T& b, C c, const T& x, const T& y) @@ -48,7 +50,7 @@ int main() test(x, y, std::greater(), x, y); test(y, x, std::greater(), x, y); } -#if _LIBCPP_STD_VER > 11 +#if TEST_STD_VER >= 14 { // Note that you can't take a reference to a local var, since // its address is not a compile-time constant. diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp index 0196d10dcd9..dd62dfd78a8 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // template @@ -16,16 +18,17 @@ #include #include +#include "test_macros.h" + int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS assert((std::minmax({1, 2, 3}) == std::pair(1, 3))); assert((std::minmax({1, 3, 2}) == std::pair(1, 3))); assert((std::minmax({2, 1, 3}) == std::pair(1, 3))); assert((std::minmax({2, 3, 1}) == std::pair(1, 3))); assert((std::minmax({3, 1, 2}) == std::pair(1, 3))); assert((std::minmax({3, 2, 1}) == std::pair(1, 3))); -#if _LIBCPP_STD_VER > 11 +#if TEST_STD_VER >= 14 { static_assert((std::minmax({1, 2, 3}) == std::pair(1, 3)), ""); static_assert((std::minmax({1, 3, 2}) == std::pair(1, 3)), ""); @@ -35,5 +38,4 @@ int main() static_assert((std::minmax({3, 2, 1}) == std::pair(1, 3)), ""); } #endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list_comp.pass.cpp index 789ccef0fca..ab20b2a0461 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list_comp.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list_comp.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // template @@ -19,11 +21,11 @@ #include #include +#include "test_macros.h" #include "counting_predicates.hpp" bool all_equal(int, int) { return false; } // everything is equal -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS void test_all_equal(std::initializer_list il) { binary_counting_predicate pred (all_equal); @@ -33,11 +35,9 @@ void test_all_equal(std::initializer_list il) assert(p.second == *--ptr); assert(pred.count() <= ((3 * il.size()) / 2)); } -#endif int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS assert((std::minmax({1, 2, 3}, std::greater()) == std::pair(3, 1))); assert((std::minmax({1, 3, 2}, std::greater()) == std::pair(3, 1))); assert((std::minmax({2, 1, 3}, std::greater()) == std::pair(3, 1))); @@ -63,7 +63,7 @@ int main() test_all_equal({0,1,2,3,4,5,6,7,8,9,10}); test_all_equal({0,1,2,3,4,5,6,7,8,9,10,11}); -#if _LIBCPP_STD_VER > 11 +#if TEST_STD_VER >= 14 { static_assert((std::minmax({1, 2, 3}, std::greater()) == std::pair(3, 1)), ""); static_assert((std::minmax({1, 3, 2}, std::greater()) == std::pair(3, 1)), ""); @@ -73,5 +73,4 @@ int main() static_assert((std::minmax({3, 2, 1}, std::greater()) == std::pair(3, 1)), ""); } #endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } -- cgit v1.2.3