[llvm] r341240 - Tests: fix tests encoding specific hash values for 32-bit systems.
Tim Northover via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 31 12:24:37 PDT 2018
Author: tnorthover
Date: Fri Aug 31 12:24:37 2018
New Revision: 341240
URL: http://llvm.org/viewvc/llvm-project?rev=341240&view=rev
Log:
Tests: fix tests encoding specific hash values for 32-bit systems.
I changed the seed slightly, but forgot to run the tests on a 32-bit system, so
tests which hard-code a specific hash value started breaking.
Modified:
llvm/trunk/unittests/ADT/HashingTest.cpp
Modified: llvm/trunk/unittests/ADT/HashingTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/HashingTest.cpp?rev=341240&r1=341239&r2=341240&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/HashingTest.cpp (original)
+++ llvm/trunk/unittests/ADT/HashingTest.cpp Fri Aug 31 12:24:37 2018
@@ -208,7 +208,7 @@ TEST(HashingTest, HashCombineRangeLength
TEST(HashingTest, HashCombineRangeGoldenTest) {
struct { const char *s; uint64_t hash; } golden_data[] = {
-#if SIZE_MAX == UINT64_MAX
+#if SIZE_MAX == UINT64_MAX || SIZE_MAX == UINT32_MAX
{ "a", 0xaeb6f9d5517c61f8ULL },
{ "ab", 0x7ab1edb96be496b4ULL },
{ "abc", 0xe38e60bf19c71a3fULL },
@@ -261,59 +261,6 @@ TEST(HashingTest, HashCombineRangeGolden
"abababababababababababababababab"
"abababababababababababababababab"
"abababababababababababababababab", 0x840192d129f7a22bULL }
-#elif SIZE_MAX == UINT32_MAX
- { "a", 0x000000004605f745ULL },
- { "ab", 0x00000000d5f06301ULL },
- { "abc", 0x00000000559fe1eeULL },
- { "abcde", 0x00000000424028d7ULL },
- { "abcdefgh", 0x000000007bb119f8ULL },
- { "abcdefghijklm", 0x00000000edbca513ULL },
- { "abcdefghijklmnopqrstu", 0x000000007c15712eULL },
- { "abcdefghijklmnopqrstuvwxyzabcdef", 0x000000000b3aad66ULL },
- { "abcdefghijklmnopqrstuvwxyzabcdef"
- "abcdefghijklmnopqrstuvwxyzghijkl"
- "abcdefghijklmnopqrstuvwxyzmnopqr"
- "abcdefghijklmnopqrstuvwxyzstuvwx"
- "abcdefghijklmnopqrstuvwxyzyzabcd", 0x000000008c758c8bULL },
- { "a", 0x000000004605f745ULL },
- { "aa", 0x00000000dc0a52daULL },
- { "aaa", 0x00000000b309274fULL },
- { "aaaaa", 0x00000000203b5ef6ULL },
- { "aaaaaaaa", 0x00000000a429e18fULL },
- { "aaaaaaaaaaaaa", 0x000000008662070bULL },
- { "aaaaaaaaaaaaaaaaaaaaa", 0x000000003f11151cULL },
- { "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 0x000000008600fe20ULL },
- { "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 0x000000004e0e0804ULL },
- { "z", 0x00000000c5e405e9ULL },
- { "zz", 0x00000000a8d8a2c6ULL },
- { "zzz", 0x00000000fc2af672ULL },
- { "zzzzz", 0x0000000047d9efe6ULL },
- { "zzzzzzzz", 0x0000000080d77794ULL },
- { "zzzzzzzzzzzzz", 0x00000000405f93adULL },
- { "zzzzzzzzzzzzzzzzzzzzz", 0x00000000fc72838dULL },
- { "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", 0x000000007ce160f1ULL },
- { "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
- "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
- "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
- "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
- "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", 0x00000000aed9ed1bULL },
- { "a", 0x000000004605f745ULL },
- { "ab", 0x00000000d5f06301ULL },
- { "aba", 0x00000000a85cd91bULL },
- { "ababa", 0x000000009e3bb52eULL },
- { "abababab", 0x000000002709b3b9ULL },
- { "ababababababa", 0x000000003a234174ULL },
- { "ababababababababababa", 0x000000005c63e5ceULL },
- { "abababababababababababababababab", 0x0000000013f74334ULL },
- { "abababababababababababababababab"
- "abababababababababababababababab"
- "abababababababababababababababab"
- "abababababababababababababababab"
- "abababababababababababababababab", 0x00000000c1a6f135ULL },
#else
#error This test only supports 64-bit and 32-bit systems.
#endif
More information about the llvm-commits
mailing list