summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/algorithms/alg.sorting
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-04-18 23:26:47 +0000
committerEric Fiselier <eric@efcs.ca>2017-04-18 23:26:47 +0000
commitddda456a76b2809e818c82d90252f42511900b12 (patch)
tree2d0f023c7cdeba05b6bd8c89f9534585fb1dc8b3 /libcxx/test/std/algorithms/alg.sorting
parent918802bed47a6083c968406371e1b3f71ae95a74 (diff)
downloadbcm5719-llvm-ddda456a76b2809e818c82d90252f42511900b12.tar.gz
bcm5719-llvm-ddda456a76b2809e818c82d90252f42511900b12.zip
Cleanup _LIBCPP_HAS_NO_<c++11-feature> in algorithm
llvm-svn: 300625
Diffstat (limited to 'libcxx/test/std/algorithms/alg.sorting')
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp7
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp9
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp9
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp9
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp9
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp9
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp9
7 files changed, 27 insertions, 34 deletions
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp
index 8e7931f7ea5..33b8ff9ae43 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp
@@ -18,9 +18,9 @@
#include <functional>
#include <random>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
struct indirect_less
{
@@ -29,7 +29,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
std::mt19937 randomness;
@@ -53,7 +52,7 @@ int main()
{
test(1000);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
const int N = 1000;
std::unique_ptr<int>* ia = new std::unique_ptr<int> [N];
@@ -68,5 +67,5 @@ int main()
}
delete [] ia;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp
index 38d09ceda6e..1b1987aa920 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp
@@ -19,9 +19,10 @@
#include <functional>
#include <random>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -29,8 +30,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
std::mt19937 randomness;
void test(int N)
@@ -51,7 +50,7 @@ int main()
{
test(1000);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
const int N = 1000;
std::unique_ptr<int>* ia = new std::unique_ptr<int> [N];
@@ -65,5 +64,5 @@ int main()
}
delete [] ia;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp
index c0a05e4209b..02839abab33 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp
@@ -18,9 +18,10 @@
#include <functional>
#include <random>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -28,8 +29,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
std::mt19937 randomness;
void test(int N)
@@ -53,7 +52,7 @@ int main()
test(10);
test(1000);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
const int N = 1000;
std::unique_ptr<int>* ia = new std::unique_ptr<int> [N];
@@ -65,5 +64,5 @@ int main()
assert(std::is_sorted(ia, ia+N, indirect_less()));
delete [] ia;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
index 88249ed78d2..fa30797bd3f 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
@@ -21,9 +21,10 @@
#include <random>
#include <cassert>
#include <cstddef>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -31,8 +32,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
std::mt19937 randomness;
void
@@ -78,7 +77,7 @@ int main()
test(1000);
test(1009);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
std::vector<std::unique_ptr<int> > v(1000);
for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
@@ -86,5 +85,5 @@ int main()
std::nth_element(v.begin(), v.begin() + v.size()/2, v.end(), indirect_less());
assert(static_cast<std::size_t>(*v[v.size()/2]) == v.size()/2);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
index 847a5829140..fb797671371 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
@@ -21,9 +21,10 @@
#include <random>
#include <cassert>
#include <cstddef>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -31,8 +32,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
std::mt19937 randomness;
void
@@ -84,7 +83,7 @@ int main()
test_larger_sorts(1009);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
std::vector<std::unique_ptr<int> > v(1000);
for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
@@ -93,5 +92,5 @@ int main()
for (int i = 0; static_cast<std::size_t>(i) < v.size()/2; ++i)
assert(*v[i] == i);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp
index c77015993c8..87d66c4723d 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp
@@ -20,9 +20,10 @@
#include <vector>
#include <cassert>
#include <cstddef>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -30,8 +31,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
int main()
{
{
@@ -43,7 +42,7 @@ int main()
assert(std::is_sorted(v.begin(), v.end()));
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
std::vector<std::unique_ptr<int> > v(1000);
for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
@@ -54,5 +53,5 @@ int main()
assert(*v[1] == 1);
assert(*v[2] == 2);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp
index 347711bf5e3..8306cc3b1b1 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp
@@ -21,9 +21,10 @@
#include <random>
#include <cassert>
#include <cstddef>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -31,8 +32,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
std::mt19937 randomness;
struct first_only
@@ -72,7 +71,7 @@ int main()
{
test();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
std::vector<std::unique_ptr<int> > v(1000);
for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
@@ -83,5 +82,5 @@ int main()
assert(*v[1] == 1);
assert(*v[2] == 2);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
OpenPOWER on IntegriCloud