summaryrefslogtreecommitdiffstats
path: root/pstl/test
diff options
context:
space:
mode:
authorLouis Dionne <ldionne@apple.com>2019-07-04 20:00:39 +0000
committerLouis Dionne <ldionne@apple.com>2019-07-04 20:00:39 +0000
commit989cad247609bc2f2ae4cd16f4e90047a7604b60 (patch)
tree1197bd7376548289f8376318984c41daff7a6bb3 /pstl/test
parentc494481ea4f866c922521fd928166d10518ab957 (diff)
downloadbcm5719-llvm-989cad247609bc2f2ae4cd16f4e90047a7604b60.tar.gz
bcm5719-llvm-989cad247609bc2f2ae4cd16f4e90047a7604b60.zip
[pstl] Use utilities from <functional> instead of reinventing the wheel
llvm-svn: 365158
Diffstat (limited to 'pstl/test')
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp10
-rw-r--r--pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp8
-rw-r--r--pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp10
3 files changed, 14 insertions, 14 deletions
diff --git a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp
index b1f6cd992db..a391ba8ba7a 100644
--- a/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp
+++ b/pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp
@@ -12,9 +12,10 @@
// Tests for stable_partition and partition_copy
#include "support/pstl_test_config.h"
-#include <execution>
#include <algorithm>
#include <cstdlib>
+#include <execution>
+#include <functional>
#include <iterator>
#include "support/utils.h"
@@ -26,16 +27,15 @@ struct test_partition_copy
template <typename Policy, typename InputIterator, typename OutputIterator, typename OutputIterator2,
typename UnaryOp>
void
- operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator true_first,
- OutputIterator, OutputIterator2 false_first, OutputIterator2, UnaryOp unary_op)
+ operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator true_first, OutputIterator,
+ OutputIterator2 false_first, OutputIterator2, UnaryOp unary_op)
{
auto actual_ret = std::partition_copy(exec, first, last, true_first, false_first, unary_op);
EXPECT_TRUE(std::distance(true_first, actual_ret.first) == std::count_if(first, last, unary_op),
"partition_copy has wrong effect from true sequence");
- EXPECT_TRUE(std::distance(false_first, actual_ret.second) ==
- std::count_if(first, last, __pstl::__internal::__not_pred<UnaryOp>(unary_op)),
+ EXPECT_TRUE(std::distance(false_first, actual_ret.second) == std::count_if(first, last, std::not_fn(unary_op)),
"partition_copy has wrong effect from false sequence");
}
diff --git a/pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp b/pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp
index 8851ceca000..2f4a72f5b2f 100644
--- a/pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp
+++ b/pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp
@@ -11,9 +11,10 @@
#include "support/pstl_test_config.h"
+#include <algorithm>
#include <cmath>
#include <execution>
-#include <algorithm>
+#include <functional>
#include "support/utils.h"
@@ -57,8 +58,7 @@ struct test_one_policy
template <typename Policy, typename InputIterator1, typename InputIterator2, typename Compare>
typename std::enable_if<TestUtils::isReverse<InputIterator1>::value, void>::type
- operator()(Policy&&, InputIterator1, InputIterator1, InputIterator2, InputIterator2,
- Compare)
+ operator()(Policy&&, InputIterator1, InputIterator1, InputIterator2, InputIterator2, Compare)
{
}
};
@@ -98,7 +98,7 @@ int32_t
main()
{
- test_includes<float64_t, float64_t>(__pstl::__internal::__pstl_less());
+ test_includes<float64_t, float64_t>(std::less<>());
test_includes<Num<int64_t>, Num<int32_t>>([](const Num<int64_t>& x, const Num<int32_t>& y) { return x < y; });
std::cout << done() << std::endl;
diff --git a/pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp b/pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp
index b54a6b6f6c1..35ab452d516 100644
--- a/pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp
+++ b/pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp
@@ -11,10 +11,11 @@
#include "support/pstl_test_config.h"
-#include <cmath>
+#include <algorithm>
#include <chrono>
+#include <cmath>
#include <execution>
-#include <algorithm>
+#include <functional>
#include "support/utils.h"
@@ -97,8 +98,7 @@ struct test_one_policy
template <typename Policy, typename InputIterator1, typename InputIterator2, typename Compare>
typename std::enable_if<TestUtils::isReverse<InputIterator1>::value, void>::type
- operator()(Policy&&, InputIterator1, InputIterator1, InputIterator2, InputIterator2,
- Compare)
+ operator()(Policy&&, InputIterator1, InputIterator1, InputIterator2, InputIterator2, Compare)
{
}
};
@@ -151,7 +151,7 @@ int32_t
main()
{
- test_set<float64_t, float64_t>(__pstl::__internal::__pstl_less());
+ test_set<float64_t, float64_t>(std::less<>());
test_set<Num<int64_t>, Num<int32_t>>([](const Num<int64_t>& x, const Num<int32_t>& y) { return x < y; });
test_algo_basic_double<int32_t>(run_for_rnd_fw<test_non_const<int32_t>>());
OpenPOWER on IntegriCloud