summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/algorithms/alg.sorting
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-10-08 01:25:23 +0000
committerEric Fiselier <eric@efcs.ca>2016-10-08 01:25:23 +0000
commite58baed3a38790e5cb26abf6a595735f9c784084 (patch)
tree9e653fef9ba7078dffa240aa062a2d4ec952c826 /libcxx/test/std/algorithms/alg.sorting
parentf96ffe1ebf5130daea67ced2940f8be49cda9d2a (diff)
downloadbcm5719-llvm-e58baed3a38790e5cb26abf6a595735f9c784084.tar.gz
bcm5719-llvm-e58baed3a38790e5cb26abf6a595735f9c784084.zip
Purge all usages of _LIBCPP_STD_VER under test/std/algorithm
llvm-svn: 283643
Diffstat (limited to 'libcxx/test/std/algorithms/alg.sorting')
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.min.max/max.pass.cpp4
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_comp.pass.cpp4
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_init_list.pass.cpp8
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_init_list_comp.pass.cpp8
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.min.max/min.pass.cpp4
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_comp.pass.cpp4
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_init_list.pass.cpp8
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_init_list_comp.pass.cpp8
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp4
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_comp.pass.cpp4
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list.pass.cpp8
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_init_list_comp.pass.cpp9
12 files changed, 47 insertions, 26 deletions
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 <algorithm>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
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 <functional>
#include <cassert>
+#include "test_macros.h"
+
template <class T, class C>
void
test(const T& a, const T& b, C c, const T& x)
@@ -45,7 +47,7 @@ int main()
test(x, y, std::greater<int>(), y);
test(y, x, std::greater<int>(), 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
+
// <algorithm>
// template <class T>
@@ -16,9 +18,10 @@
#include <algorithm>
#include <cassert>
+#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
+
// <algorithm>
// template<class T, class Compare>
@@ -17,9 +19,10 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
int i = std::max({2, 3, 1}, std::greater<int>());
assert(i == 1);
i = std::max({2, 1, 3}, std::greater<int>());
@@ -32,12 +35,11 @@ int main()
assert(i == 1);
i = std::max({1, 3, 2}, std::greater<int>());
assert(i == 1);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 14
{
static_assert(std::max({1, 3, 2}, std::greater<int>()) == 1, "");
static_assert(std::max({2, 1, 3}, std::greater<int>()) == 1, "");
static_assert(std::max({3, 2, 1}, std::greater<int>()) == 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 <algorithm>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
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 <functional>
#include <cassert>
+#include "test_macros.h"
+
template <class T, class C>
void
test(const T& a, const T& b, C c, const T& x)
@@ -45,7 +47,7 @@ int main()
test(x, y, std::greater<int>(), x);
test(y, x, std::greater<int>(), 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
+
// <algorithm>
// template<class T>
@@ -16,9 +18,10 @@
#include <algorithm>
#include <cassert>
+#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
+
// <algorithm>
// template<class T, class Compare>
@@ -17,9 +19,10 @@
#include <functional>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
int i = std::min({2, 3, 1}, std::greater<int>());
assert(i == 3);
i = std::min({2, 1, 3}, std::greater<int>());
@@ -32,12 +35,11 @@ int main()
assert(i == 3);
i = std::min({1, 3, 2}, std::greater<int>());
assert(i == 3);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 14
{
static_assert(std::min({1, 3, 2}, std::greater<int>()) == 3, "");
static_assert(std::min({2, 1, 3}, std::greater<int>()) == 3, "");
static_assert(std::min({3, 2, 1}, std::greater<int>()) == 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 <algorithm>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
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 <functional>
#include <cassert>
+#include "test_macros.h"
+
template <class T, class C>
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<int>(), x, y);
test(y, x, std::greater<int>(), 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
+
// <algorithm>
// template<class T>
@@ -16,16 +18,17 @@
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
assert((std::minmax({1, 2, 3}) == std::pair<int, int>(1, 3)));
assert((std::minmax({1, 3, 2}) == std::pair<int, int>(1, 3)));
assert((std::minmax({2, 1, 3}) == std::pair<int, int>(1, 3)));
assert((std::minmax({2, 3, 1}) == std::pair<int, int>(1, 3)));
assert((std::minmax({3, 1, 2}) == std::pair<int, int>(1, 3)));
assert((std::minmax({3, 2, 1}) == std::pair<int, int>(1, 3)));
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER >= 14
{
static_assert((std::minmax({1, 2, 3}) == std::pair<int, int>(1, 3)), "");
static_assert((std::minmax({1, 3, 2}) == std::pair<int, int>(1, 3)), "");
@@ -35,5 +38,4 @@ int main()
static_assert((std::minmax({3, 2, 1}) == std::pair<int, int>(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
+
// <algorithm>
// template<class T, class Compare>
@@ -19,11 +21,11 @@
#include <functional>
#include <cassert>
+#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<int> il)
{
binary_counting_predicate<bool(*)(int, int), int, int> pred (all_equal);
@@ -33,11 +35,9 @@ void test_all_equal(std::initializer_list<int> 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<int>()) == std::pair<int, int>(3, 1)));
assert((std::minmax({1, 3, 2}, std::greater<int>()) == std::pair<int, int>(3, 1)));
assert((std::minmax({2, 1, 3}, std::greater<int>()) == std::pair<int, int>(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<int>()) == std::pair<int, int>(3, 1)), "");
static_assert((std::minmax({1, 3, 2}, std::greater<int>()) == std::pair<int, int>(3, 1)), "");
@@ -73,5 +73,4 @@ int main()
static_assert((std::minmax({3, 2, 1}, std::greater<int>()) == std::pair<int, int>(3, 1)), "");
}
#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}
OpenPOWER on IntegriCloud