summaryrefslogtreecommitdiff
path: root/test/libcxx
diff options
context:
space:
mode:
authorLouis Dionne <ldionne@apple.com>2018-11-01 21:24:32 +0000
committerLouis Dionne <ldionne@apple.com>2018-11-01 21:24:32 +0000
commit5dc37768e2337c4d584078843e8aeed80b87215f (patch)
treeb1c0224da3a557152898851527b436d1000854dd /test/libcxx
parent6115b72f60cdda6154a7764fd26fce33b7ab746e (diff)
downloadlibcxx-5dc37768e2337c4d584078843e8aeed80b87215f.tar.gz
Revert "Bug 39129: Speeding up partition_point/lower_bound/upper_bound/ by using unsigned division by 2 when possible."
This reverts r345525. I'm reverting because that patch apparently caused a regression on certain platforms (see https://reviews.llvm.org/D53994). Since we don't fully understand the reasons for the regression, I'm reverting until we can provide a fix we understand. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@345893 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/libcxx')
-rw-r--r--test/libcxx/algorithms/half_positive.pass.cpp59
1 files changed, 0 insertions, 59 deletions
diff --git a/test/libcxx/algorithms/half_positive.pass.cpp b/test/libcxx/algorithms/half_positive.pass.cpp
deleted file mode 100644
index 178055cbb..000000000
--- a/test/libcxx/algorithms/half_positive.pass.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <algorithm>
-
-// template <typename _Tp> _Tp __half_positive(const _Tp&);
-
-// __half_positive divide integer number by 2 as unsigned number
-// if it's safe to do so. It can be an important optimization for lower bound,
-// for example.
-
-#include <algorithm>
-#include <cassert>
-#include <limits>
-#include <type_traits>
-
-#include "test_macros.h"
-#include "user_defined_integral.hpp"
-
-namespace {
-
-template <class IntType, class UnderlyingType = IntType>
-TEST_CONSTEXPR bool test(IntType max_v = IntType(std::numeric_limits<UnderlyingType>::max())) {
- return std::__half_positive(max_v) == max_v / 2;
-}
-
-} // namespace
-
-int main()
-{
- {
- assert(test<char>());
- assert(test<int>());
- assert(test<long>());
- assert((test<UserDefinedIntegral<int>, int>()));
- assert(test<size_t>());
-#if !defined(_LIBCPP_HAS_NO_INT128)
- assert(test<__int128_t>());
-#endif // !defined(_LIBCPP_HAS_NO_INT128)
- }
-
-#if TEST_STD_VER >= 11
- {
- static_assert(test<char>(), "");
- static_assert(test<int>(), "");
- static_assert(test<long>(), "");
- static_assert(test<size_t>(), "");
-#if !defined(_LIBCPP_HAS_NO_INT128)
- static_assert(test<__int128_t>(), "");
-#endif // !defined(_LIBCPP_HAS_NO_INT128)
- }
-#endif // TEST_STD_VER >= 11
-}