forked from OSchip/llvm-project
[libcxx] [test] Strip trailing whitespace. NFC.
llvm-svn: 302105
This commit is contained in:
parent
a7e1ac58c4
commit
6081edc9d0
|
@ -12,7 +12,7 @@
|
||||||
// template <class RandomAccessIterator>
|
// template <class RandomAccessIterator>
|
||||||
// void
|
// void
|
||||||
// random_shuffle(RandomAccessIterator first, RandomAccessIterator last);
|
// random_shuffle(RandomAccessIterator first, RandomAccessIterator last);
|
||||||
//
|
//
|
||||||
// template <class RandomAccessIterator, class RandomNumberGenerator>
|
// template <class RandomAccessIterator, class RandomNumberGenerator>
|
||||||
// void
|
// void
|
||||||
// random_shuffle(RandomAccessIterator first, RandomAccessIterator last,
|
// random_shuffle(RandomAccessIterator first, RandomAccessIterator last,
|
||||||
|
|
|
@ -34,14 +34,14 @@ int main()
|
||||||
typedef std::pointer_to_binary_function<int, int, int> PBF;
|
typedef std::pointer_to_binary_function<int, int, int> PBF;
|
||||||
assert((std::ptr_fun<int, int>(identity)(4) == 4));
|
assert((std::ptr_fun<int, int>(identity)(4) == 4));
|
||||||
assert((std::ptr_fun<int, int, int>(sum)(4, 5) == 9));
|
assert((std::ptr_fun<int, int, int>(sum)(4, 5) == 9));
|
||||||
|
|
||||||
Foo f;
|
Foo f;
|
||||||
assert((std::mem_fn(&Foo::identity)(f, 5) == 5));
|
assert((std::mem_fn(&Foo::identity)(f, 5) == 5));
|
||||||
assert((std::mem_fn(&Foo::sum)(f, 5, 6) == 11));
|
assert((std::mem_fn(&Foo::sum)(f, 5, 6) == 11));
|
||||||
|
|
||||||
typedef std::mem_fun_ref_t<int, Foo> MFR;
|
typedef std::mem_fun_ref_t<int, Foo> MFR;
|
||||||
typedef std::const_mem_fun_ref_t<int, Foo> CMFR;
|
typedef std::const_mem_fun_ref_t<int, Foo> CMFR;
|
||||||
|
|
||||||
assert((std::mem_fun_ref(&Foo::zero)(f) == 0));
|
assert((std::mem_fun_ref(&Foo::zero)(f) == 0));
|
||||||
assert((std::mem_fun_ref(&Foo::identity)(f, 5) == 5));
|
assert((std::mem_fun_ref(&Foo::identity)(f, 5) == 5));
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ test()
|
||||||
int ia[] = {0, 1, 2, 3, 4, 2, 3, 4, 2};
|
int ia[] = {0, 1, 2, 3, 4, 2, 3, 4, 2};
|
||||||
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
|
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
|
||||||
int ib[sa];
|
int ib[sa];
|
||||||
OutIter r = std::remove_copy_if(InIter(ia), InIter(ia+sa),
|
OutIter r = std::remove_copy_if(InIter(ia), InIter(ia+sa),
|
||||||
OutIter(ib), equalToTwo);
|
OutIter(ib), equalToTwo);
|
||||||
assert(base(r) == ib + sa-3);
|
assert(base(r) == ib + sa-3);
|
||||||
assert(ib[0] == 0);
|
assert(ib[0] == 0);
|
||||||
|
|
|
@ -25,7 +25,7 @@ struct eq {
|
||||||
bool operator () (int v2) const { return v == v2; }
|
bool operator () (int v2) const { return v == v2; }
|
||||||
int v;
|
int v;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,7 +25,7 @@ struct eq {
|
||||||
bool operator () (int v2) const { return v == v2; }
|
bool operator () (int v2) const { return v == v2; }
|
||||||
int v;
|
int v;
|
||||||
};
|
};
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
int ia[] = {0, 1, 2, 3, 4, 5};
|
int ia[] = {0, 1, 2, 3, 4, 5};
|
||||||
|
|
|
@ -25,7 +25,7 @@ struct ne {
|
||||||
bool operator () (int v2) const { return v != v2; }
|
bool operator () (int v2) const { return v != v2; }
|
||||||
int v;
|
int v;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,7 +32,7 @@ int main()
|
||||||
static_assert((std::is_same<H::argument_type, T>::value), "" );
|
static_assert((std::is_same<H::argument_type, T>::value), "" );
|
||||||
static_assert((std::is_same<H::result_type, std::size_t>::value), "" );
|
static_assert((std::is_same<H::result_type, std::size_t>::value), "" );
|
||||||
ASSERT_NOEXCEPT(H()(T()));
|
ASSERT_NOEXCEPT(H()(T()));
|
||||||
|
|
||||||
bool ba[] = {true, false, true, true, false};
|
bool ba[] = {true, false, true, true, false};
|
||||||
T vb(std::begin(ba), std::end(ba));
|
T vb(std::begin(ba), std::end(ba));
|
||||||
H h;
|
H h;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
// XFAIL: c++98, c++03, c++11, c++14
|
// XFAIL: c++98, c++03, c++11, c++14
|
||||||
|
|
||||||
// std::byte is not an integer type, nor a character type.
|
// std::byte is not an integer type, nor a character type.
|
||||||
// It is a distinct type for accessing the bits that ultimately make up object storage.
|
// It is a distinct type for accessing the bits that ultimately make up object storage.
|
||||||
|
|
||||||
static_assert( std::is_pod<std::byte>::value, "" );
|
static_assert( std::is_pod<std::byte>::value, "" );
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// template <class IntegerType>
|
// template <class IntegerType>
|
||||||
// constexpr byte& operator<<=(byte& b, IntegerType shift) noexcept;
|
// constexpr byte& operator<<=(byte& b, IntegerType shift) noexcept;
|
||||||
// This function shall not participate in overload resolution unless
|
// This function shall not participate in overload resolution unless
|
||||||
// is_integral_v<IntegerType> is true.
|
// is_integral_v<IntegerType> is true.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// template <class IntegerType>
|
// template <class IntegerType>
|
||||||
// constexpr byte& operator<<=(byte& b, IntegerType shift) noexcept;
|
// constexpr byte& operator<<=(byte& b, IntegerType shift) noexcept;
|
||||||
// This function shall not participate in overload resolution unless
|
// This function shall not participate in overload resolution unless
|
||||||
// is_integral_v<IntegerType> is true.
|
// is_integral_v<IntegerType> is true.
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ int main () {
|
||||||
constexpr std::byte b3{3};
|
constexpr std::byte b3{3};
|
||||||
|
|
||||||
static_assert(noexcept(b <<= 2), "" );
|
static_assert(noexcept(b <<= 2), "" );
|
||||||
|
|
||||||
static_assert(std::to_integer<int>(test(b2)) == 8, "" );
|
static_assert(std::to_integer<int>(test(b2)) == 8, "" );
|
||||||
static_assert(std::to_integer<int>(test(b3)) == 12, "" );
|
static_assert(std::to_integer<int>(test(b3)) == 12, "" );
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// template <class IntegerType>
|
// template <class IntegerType>
|
||||||
// constexpr byte operator <<(byte b, IntegerType shift) noexcept;
|
// constexpr byte operator <<(byte b, IntegerType shift) noexcept;
|
||||||
// These functions shall not participate in overload resolution unless
|
// These functions shall not participate in overload resolution unless
|
||||||
// is_integral_v<IntegerType> is true.
|
// is_integral_v<IntegerType> is true.
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
|
|
|
@ -17,17 +17,17 @@
|
||||||
|
|
||||||
// template <class IntegerType>
|
// template <class IntegerType>
|
||||||
// constexpr byte operator <<(byte b, IntegerType shift) noexcept;
|
// constexpr byte operator <<(byte b, IntegerType shift) noexcept;
|
||||||
// These functions shall not participate in overload resolution unless
|
// These functions shall not participate in overload resolution unless
|
||||||
// is_integral_v<IntegerType> is true.
|
// is_integral_v<IntegerType> is true.
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
constexpr std::byte b1{1};
|
constexpr std::byte b1{1};
|
||||||
constexpr std::byte b3{3};
|
constexpr std::byte b3{3};
|
||||||
|
|
||||||
static_assert(noexcept(b3 << 2), "" );
|
static_assert(noexcept(b3 << 2), "" );
|
||||||
|
|
||||||
static_assert(std::to_integer<int>(b1 << 1) == 2, "");
|
static_assert(std::to_integer<int>(b1 << 1) == 2, "");
|
||||||
static_assert(std::to_integer<int>(b1 << 2) == 4, "");
|
static_assert(std::to_integer<int>(b1 << 2) == 4, "");
|
||||||
static_assert(std::to_integer<int>(b3 << 4) == 48, "");
|
static_assert(std::to_integer<int>(b3 << 4) == 48, "");
|
||||||
static_assert(std::to_integer<int>(b3 << 6) == 192, "");
|
static_assert(std::to_integer<int>(b3 << 6) == 192, "");
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// template <class IntegerType>
|
// template <class IntegerType>
|
||||||
// constexpr byte operator>>(byte& b, IntegerType shift) noexcept;
|
// constexpr byte operator>>(byte& b, IntegerType shift) noexcept;
|
||||||
// This function shall not participate in overload resolution unless
|
// This function shall not participate in overload resolution unless
|
||||||
// is_integral_v<IntegerType> is true.
|
// is_integral_v<IntegerType> is true.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// template <class IntegerType>
|
// template <class IntegerType>
|
||||||
// constexpr byte& operator>>=(byte& b, IntegerType shift) noexcept;
|
// constexpr byte& operator>>=(byte& b, IntegerType shift) noexcept;
|
||||||
// This function shall not participate in overload resolution unless
|
// This function shall not participate in overload resolution unless
|
||||||
// is_integral_v<IntegerType> is true.
|
// is_integral_v<IntegerType> is true.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// template <class IntegerType>
|
// template <class IntegerType>
|
||||||
// constexpr byte operator >>(byte b, IntegerType shift) noexcept;
|
// constexpr byte operator >>(byte b, IntegerType shift) noexcept;
|
||||||
// These functions shall not participate in overload resolution unless
|
// These functions shall not participate in overload resolution unless
|
||||||
// is_integral_v<IntegerType> is true.
|
// is_integral_v<IntegerType> is true.
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// template <class IntegerType>
|
// template <class IntegerType>
|
||||||
// constexpr byte operator <<(byte b, IntegerType shift) noexcept;
|
// constexpr byte operator <<(byte b, IntegerType shift) noexcept;
|
||||||
// These functions shall not participate in overload resolution unless
|
// These functions shall not participate in overload resolution unless
|
||||||
// is_integral_v<IntegerType> is true.
|
// is_integral_v<IntegerType> is true.
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,12 +29,12 @@ constexpr std::byte test(std::byte b) {
|
||||||
int main () {
|
int main () {
|
||||||
constexpr std::byte b100{100};
|
constexpr std::byte b100{100};
|
||||||
constexpr std::byte b115{115};
|
constexpr std::byte b115{115};
|
||||||
|
|
||||||
static_assert(noexcept(b100 << 2), "" );
|
static_assert(noexcept(b100 << 2), "" );
|
||||||
|
|
||||||
static_assert(std::to_integer<int>(b100 >> 1) == 50, "");
|
static_assert(std::to_integer<int>(b100 >> 1) == 50, "");
|
||||||
static_assert(std::to_integer<int>(b100 >> 2) == 25, "");
|
static_assert(std::to_integer<int>(b100 >> 2) == 25, "");
|
||||||
static_assert(std::to_integer<int>(b115 >> 3) == 14, "");
|
static_assert(std::to_integer<int>(b115 >> 3) == 14, "");
|
||||||
static_assert(std::to_integer<int>(b115 >> 6) == 1, "");
|
static_assert(std::to_integer<int>(b115 >> 6) == 1, "");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// template <class IntegerType>
|
// template <class IntegerType>
|
||||||
// constexpr IntegerType to_integer(byte b) noexcept;
|
// constexpr IntegerType to_integer(byte b) noexcept;
|
||||||
// This function shall not participate in overload resolution unless
|
// This function shall not participate in overload resolution unless
|
||||||
// is_integral_v<IntegerType> is true.
|
// is_integral_v<IntegerType> is true.
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
|
|
|
@ -17,13 +17,13 @@
|
||||||
|
|
||||||
// template <class IntegerType>
|
// template <class IntegerType>
|
||||||
// constexpr IntegerType to_integer(byte b) noexcept;
|
// constexpr IntegerType to_integer(byte b) noexcept;
|
||||||
// This function shall not participate in overload resolution unless
|
// This function shall not participate in overload resolution unless
|
||||||
// is_integral_v<IntegerType> is true.
|
// is_integral_v<IntegerType> is true.
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
constexpr std::byte b1{1};
|
constexpr std::byte b1{1};
|
||||||
constexpr std::byte b3{3};
|
constexpr std::byte b3{3};
|
||||||
|
|
||||||
static_assert(noexcept(std::to_integer<int>(b1)), "" );
|
static_assert(noexcept(std::to_integer<int>(b1)), "" );
|
||||||
static_assert(std::is_same<int, decltype(std::to_integer<int>(b1))>::value, "" );
|
static_assert(std::is_same<int, decltype(std::to_integer<int>(b1))>::value, "" );
|
||||||
static_assert(std::is_same<long, decltype(std::to_integer<long>(b1))>::value, "" );
|
static_assert(std::is_same<long, decltype(std::to_integer<long>(b1))>::value, "" );
|
||||||
|
|
|
@ -620,7 +620,7 @@ int main()
|
||||||
{
|
{
|
||||||
std::cmatch m;
|
std::cmatch m;
|
||||||
const char s[] = "m";
|
const char s[] = "m";
|
||||||
assert(std::regex_match(s, m,
|
assert(std::regex_match(s, m,
|
||||||
std::regex("[a[=M=]z]", std::regex_constants::awk)));
|
std::regex("[a[=M=]z]", std::regex_constants::awk)));
|
||||||
assert(m.size() == 1);
|
assert(m.size() == 1);
|
||||||
assert(!m.prefix().matched);
|
assert(!m.prefix().matched);
|
||||||
|
|
|
@ -52,7 +52,7 @@ int main()
|
||||||
std::this_thread::sleep_for(ms(250));
|
std::this_thread::sleep_for(ms(250));
|
||||||
m.unlock();
|
m.unlock();
|
||||||
t.join();
|
t.join();
|
||||||
|
|
||||||
#ifdef __cpp_deduction_guides
|
#ifdef __cpp_deduction_guides
|
||||||
std::lock_guard lg(m);
|
std::lock_guard lg(m);
|
||||||
static_assert((std::is_same<decltype(lg), std::lock_guard<decltype(m)>>::value), "" );
|
static_assert((std::is_same<decltype(lg), std::lock_guard<decltype(m)>>::value), "" );
|
||||||
|
|
|
@ -150,6 +150,6 @@ int main()
|
||||||
std::scoped_lock sl{m1, m2, m3};
|
std::scoped_lock sl{m1, m2, m3};
|
||||||
static_assert((std::is_same<decltype(sl), std::scoped_lock<decltype(m1), decltype(m2), decltype(m3)>>::value), "" );
|
static_assert((std::is_same<decltype(sl), std::scoped_lock<decltype(m1), decltype(m2), decltype(m3)>>::value), "" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ int main()
|
||||||
static_assert((std::is_same<std::shared_ptr<int>, CS::first_argument_type>::value), "" );
|
static_assert((std::is_same<std::shared_ptr<int>, CS::first_argument_type>::value), "" );
|
||||||
static_assert((std::is_same<std::shared_ptr<int>, CS::second_argument_type>::value), "" );
|
static_assert((std::is_same<std::shared_ptr<int>, CS::second_argument_type>::value), "" );
|
||||||
static_assert((std::is_same<bool, CS::result_type>::value), "" );
|
static_assert((std::is_same<bool, CS::result_type>::value), "" );
|
||||||
|
|
||||||
assert(!cs(p1, p2));
|
assert(!cs(p1, p2));
|
||||||
assert(!cs(p2, p1));
|
assert(!cs(p2, p1));
|
||||||
assert(cs(p1 ,p3) || cs(p3, p1));
|
assert(cs(p1 ,p3) || cs(p3, p1));
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// <optional>
|
// <optional>
|
||||||
|
|
||||||
// constexpr optional(const optional<T>& rhs);
|
// constexpr optional(const optional<T>& rhs);
|
||||||
// If is_trivially_copy_constructible_v<T> is true,
|
// If is_trivially_copy_constructible_v<T> is true,
|
||||||
// this constructor shall be a constexpr constructor.
|
// this constructor shall be a constexpr constructor.
|
||||||
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
@ -26,7 +26,7 @@ struct S {
|
||||||
S(const S &rhs) : v_(rhs.v_) {} // make it not trivially copyable
|
S(const S &rhs) : v_(rhs.v_) {} // make it not trivially copyable
|
||||||
int v_;
|
int v_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// <optional>
|
// <optional>
|
||||||
|
|
||||||
// constexpr optional(const optional<T>&& rhs);
|
// constexpr optional(const optional<T>&& rhs);
|
||||||
// If is_trivially_move_constructible_v<T> is true,
|
// If is_trivially_move_constructible_v<T> is true,
|
||||||
// this constructor shall be a constexpr constructor.
|
// this constructor shall be a constexpr constructor.
|
||||||
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
@ -27,7 +27,7 @@ struct S {
|
||||||
constexpr S(const S &&rhs) : v_(rhs.v_) {} // not trivially moveable
|
constexpr S(const S &&rhs) : v_(rhs.v_) {} // not trivially moveable
|
||||||
int v_;
|
int v_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,7 +31,7 @@ test()
|
||||||
static_assert((std::is_same<typename H::argument_type, T>::value), "" );
|
static_assert((std::is_same<typename H::argument_type, T>::value), "" );
|
||||||
static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
|
static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
|
||||||
ASSERT_NOEXCEPT(H()(T()));
|
ASSERT_NOEXCEPT(H()(T()));
|
||||||
|
|
||||||
H h;
|
H h;
|
||||||
T bs(static_cast<unsigned long long>(N));
|
T bs(static_cast<unsigned long long>(N));
|
||||||
const std::size_t result = h(bs);
|
const std::size_t result = h(bs);
|
||||||
|
|
Loading…
Reference in New Issue