diff options
| author | Eric Fiselier <eric@efcs.ca> | 2016-06-22 00:53:35 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2016-06-22 00:53:35 +0000 |
| commit | 5f15481f87059cd7382aa14609fc8a5c839deda0 (patch) | |
| tree | cb21f7cd6336af39ab679418ca24411f51927c39 /libcxx/test/std | |
| parent | c36f0331df4ee1db4f2542bf4fa4e798c31d0718 (diff) | |
| download | bcm5719-llvm-5f15481f87059cd7382aa14609fc8a5c839deda0.tar.gz bcm5719-llvm-5f15481f87059cd7382aa14609fc8a5c839deda0.zip | |
Guard libc++ assumption about identity hashing in test. Patch from STL@microsoft.com
llvm-svn: 273345
Diffstat (limited to 'libcxx/test/std')
| -rw-r--r-- | libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp b/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp index 3e4dec1e761..8954f4f3664 100644 --- a/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp @@ -16,14 +16,14 @@ // size_t operator()(T val) const; // }; -// Not very portable - #include <functional> #include <cassert> #include <type_traits> #include <cstddef> #include <limits> +#include "test_macros.h" + template <class T> void test() @@ -37,7 +37,11 @@ test() { T t(i); if (sizeof(T) <= sizeof(std::size_t)) - assert(h(t) == t); + { + const std::size_t result = h(t); + LIBCPP_ASSERT(result == t); + ((void)result); // Prevent unused warning + } } } |

