diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2017-11-28 01:27:22 +0300 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2017-11-28 01:27:22 +0300 |
commit | ea44ee202f6a73bfd832d89bd882b34cda9ca65e (patch) | |
tree | adb715061579324d4a04659a1f55d6241682dff2 /libcxx/test/std | |
parent | 8eaa8ec8fc9591bc71675605a3cee24a17d16d3f (diff) |
Fix problems with r'890 when building on machines where sizeof(size_t) != sizeof(unsigned long long) and C++03
llvm-svn: 319106
Diffstat (limited to 'libcxx/test/std')
-rw-r--r-- | libcxx/test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp | 3 | ||||
-rw-r--r-- | libcxx/test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp | 6 |
2 files changed, 3 insertions, 6 deletions
diff --git a/libcxx/test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp b/libcxx/test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp index fb3502983e67..c4a818f60f52 100644 --- a/libcxx/test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp +++ b/libcxx/test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // test unsigned long long to_ullong() const; +extern "C" int printf(const char *, ...); #include <bitset> #include <algorithm> @@ -37,7 +38,7 @@ void test_to_ullong() assert(j == v.to_ullong()); } { // test values bigger than can fit into the bitset - const unsigned long long val = 0xAAAAAAAAAAAAAAAAULL; + const unsigned long long val = 0x55AAAAFFFFAAAA55ULL; const bool canFit = N < sizeof(unsigned long long) * CHAR_BIT; const unsigned long long mask = canFit ? (1ULL << N) - 1 : (unsigned long long)(-1); std::bitset<N> v(val); diff --git a/libcxx/test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp b/libcxx/test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp index 86b481579f39..536c272e0e0b 100644 --- a/libcxx/test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp +++ b/libcxx/test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp @@ -16,12 +16,9 @@ #include <climits> #include <cassert> -#include <iostream> - template <std::size_t N> void test_to_ulong() { - std::cout << "Testing size = " << N << std::endl; const std::size_t M = sizeof(unsigned long) * CHAR_BIT < N ? sizeof(unsigned long) * CHAR_BIT : N; const bool is_M_zero = std::integral_constant<bool, M == 0>::value; // avoid compiler warnings const std::size_t X = is_M_zero ? sizeof(unsigned long) * CHAR_BIT - 1 : sizeof(unsigned long) * CHAR_BIT - M; @@ -37,13 +34,12 @@ void test_to_ulong() for (std::size_t i = 0; i < sizeof(tests)/sizeof(tests[0]); ++i) { std::size_t j = tests[i]; - std::cout << " Testing value = " << j << std::endl; std::bitset<N> v(j); assert(j == v.to_ulong()); } { // test values bigger than can fit into the bitset - const unsigned long val = 0xAAAAAAAAULL; + const unsigned long val = 0x5AFFFFA5ULL; const bool canFit = N < sizeof(unsigned long) * CHAR_BIT; const unsigned long mask = canFit ? (1ULL << N) - 1 : (unsigned long)(-1); std::bitset<N> v(val); |