[all-commits] [llvm/llvm-project] 0d4b6f: [sanitizer_common] Fix DenseMapCustomTest.DefaultM...

rorth via All-commits all-commits at lists.llvm.org
Wed Feb 9 00:12:29 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0d4b6f1f4b7b5f20698aae42a616b1bb3e18ef85
      https://github.com/llvm/llvm-project/commit/0d4b6f1f4b7b5f20698aae42a616b1bb3e18ef85
  Author: Rainer Orth <ro at gcc.gnu.org>
  Date:   2022-02-09 (Wed, 09 Feb 2022)

  Changed paths:
    M compiler-rt/lib/sanitizer_common/tests/sanitizer_dense_map_test.cpp

  Log Message:
  -----------
  [sanitizer_common] Fix DenseMapCustomTest.DefaultMinReservedSizeTest on SPARC

As described in Issue #53523, the
`DenseMapCustomTest.DefaultMinReservedSizeTest` test FAILs on Solaris/SPARC
(both 32 and 64-bit):

  /vol/llvm/src/llvm-project/local/compiler-rt/lib/sanitizer_common/tests/sanitizer_dense_map_test.cpp:399:
Failure
  Expected: (MemorySize) != (Map.getMemorySize()), actual: 8192 vs 8192

This happens because SPARC, unlike many other CPUs, uses an 8 kB pagesize.

Fixed by incorporating the pagesize into the calculations of
`ExpectedInitialBucketCount` and derived values.

Tested on `sparcv9-sun-solaris2.11`, `amd64-pc-solaris2.11`, and
`x86_64-pc-linux-gnu`.

Differential Revision: https://reviews.llvm.org/D118771




More information about the All-commits mailing list