summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2018-08-31 19:24:37 +0000
committerTim Northover <tnorthover@apple.com>2018-08-31 19:24:37 +0000
commitcc8f593d29abe99c2b049097c3c056809bfb0ddd (patch)
tree317d45dd0428dc9849f91752d1f6cd20790e673e
parent250c56d12788cc4d57c19fc65052ae052dd830d7 (diff)
downloadbcm5719-llvm-cc8f593d29abe99c2b049097c3c056809bfb0ddd.tar.gz
bcm5719-llvm-cc8f593d29abe99c2b049097c3c056809bfb0ddd.zip
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. llvm-svn: 341240
-rw-r--r--clang/test/CodeGenCXX/catch-undef-behavior.cpp4
-rw-r--r--llvm/unittests/ADT/HashingTest.cpp55
2 files changed, 3 insertions, 56 deletions
diff --git a/clang/test/CodeGenCXX/catch-undef-behavior.cpp b/clang/test/CodeGenCXX/catch-undef-behavior.cpp
index 4513936e49a..50a05a06bf6 100644
--- a/clang/test/CodeGenCXX/catch-undef-behavior.cpp
+++ b/clang/test/CodeGenCXX/catch-undef-behavior.cpp
@@ -72,7 +72,7 @@ void member_access(S *p) {
// The two hash values are for 64- and 32-bit Clang binaries, respectively.
// FIXME: We should produce a 64-bit value either way.
//
- // CHECK-NEXT: xor i64 {{-4030275160588942838|2562089159}}, %[[VPTR]]
+ // CHECK-NEXT: xor i64 {{-4030275160588942838|1107558922}}, %[[VPTR]]
// CHECK-NEXT: mul i64 {{.*}}, -7070675565921424023
// CHECK-NEXT: lshr i64 {{.*}}, 47
// CHECK-NEXT: xor i64
@@ -121,7 +121,7 @@ void member_access(S *p) {
// (3b) Check that 'p' actually points to an 'S'
// CHECK: load i64, i64*
- // CHECK-NEXT: xor i64 {{-4030275160588942838|2562089159}},
+ // CHECK-NEXT: xor i64 {{-4030275160588942838|1107558922}},
// [...]
// CHECK: getelementptr inbounds [128 x i64], [128 x i64]* @__ubsan_vptr_type_cache, i32 0, i64 %
// CHECK: br i1
diff --git a/llvm/unittests/ADT/HashingTest.cpp b/llvm/unittests/ADT/HashingTest.cpp
index 367f58dc7a6..d96dd7e2f07 100644
--- a/llvm/unittests/ADT/HashingTest.cpp
+++ b/llvm/unittests/ADT/HashingTest.cpp
@@ -208,7 +208,7 @@ TEST(HashingTest, HashCombineRangeLengthDiff) {
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, HashCombineRangeGoldenTest) {
"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
OpenPOWER on IntegriCloud