summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-06-15 01:42:35 +0000
committerEric Fiselier <eric@efcs.ca>2016-06-15 01:42:35 +0000
commit78f8ce484f8373a196ab729e00a045972d91d7f3 (patch)
tree027ceca79d365db6420939b321eb06119aedd3e3 /libcxx/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp
parentc4989d27b581a67c3a92be8e7b5005beae90e5c6 (diff)
downloadbcm5719-llvm-78f8ce484f8373a196ab729e00a045972d91d7f3.tar.gz
bcm5719-llvm-78f8ce484f8373a196ab729e00a045972d91d7f3.zip
Improve portability of hash tests. Patch from STL@microsoft.com
llvm-svn: 272744
Diffstat (limited to 'libcxx/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp')
-rw-r--r--libcxx/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/libcxx/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp b/libcxx/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp
index 520f2e8757c..bc65078911b 100644
--- a/libcxx/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp
+++ b/libcxx/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp
@@ -16,12 +16,12 @@
// size_t operator()(T val) const;
// };
-// Not very portable
-
#include <bitset>
#include <cassert>
#include <type_traits>
+#include "test_macros.h"
+
template <std::size_t N>
void
test()
@@ -32,7 +32,9 @@ test()
static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
H h;
T bs(static_cast<unsigned long long>(N));
- assert(h(bs) == N);
+ const std::size_t result = h(bs);
+ LIBCPP_ASSERT(result == N);
+ ((void)result); // Prevent unused warning
}
int main()
OpenPOWER on IntegriCloud