[all-commits] [llvm/llvm-project] d83c90: [sanitizer_common][test] Enable tests on SPARC

rorth via All-commits all-commits at lists.llvm.org
Tue Feb 1 13:34:43 PST 2022


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

  Changed paths:
    M compiler-rt/include/sanitizer/common_interface_defs.h
    M compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
    M compiler-rt/test/sanitizer_common/TestCases/symbolize_pc.cpp
    M compiler-rt/test/sanitizer_common/TestCases/symbolize_pc_demangle.cpp
    M compiler-rt/test/sanitizer_common/TestCases/symbolize_pc_inline.cpp

  Log Message:
  -----------
  [sanitizer_common][test] Enable tests on SPARC

Unfortunately, the `sanitizer_common` tests are disabled on many targets
that are supported by `sanitizer_common`, making it easy to miss issues
with that support.  This patch enables SPARC testing.

Beside the enabling proper, the patch fixes (together with D91607
<https://reviews.llvm.org/D91607>) the failures of the `symbolize_pc.cpp`,
`symbolize_pc_demangle.cpp`, and `symbolize_pc_inline.cpp` tests.  They
lack calls to `__builtin_extract_return_addr`.  When those are added, they
`PASS` when compiled with `gcc`.  `clang` incorrectly doesn't implement a
non-default `__builtin_extract_return_addr` on several targets, SPARC
included.

Because `__builtin_extract_return_addr(__builtin_return_addr(0))` is quite
a mouthful and I'm uncertain if the code needs to compile with msvc which
appparently has it's own `_ReturnAddress`, I've introduced
`__sanitizer_return_addr` to hide the difference and complexity.  Because
on 32-bit SPARC `__builtin_extract_return_addr` differs when the calling
function returns a struct, I've added a testcase for that.

There are a couple more tests failing on SPARC that I will deal with
separately.

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

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




More information about the All-commits mailing list