[PATCH] D91608: [sanitizer_common][test] Enable tests on SPARC
Rainer Orth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 17 03:23:56 PST 2020
ro created this revision.
ro added a reviewer: vitalybuka.
ro added a project: Sanitizers.
Herald added subscribers: Sanitizers, pengfei, s.egerton, simoncook, fedor.sergeev, mgorny, jyknight.
ro requested review of this revision.
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` and `symbolize_pc_inline.cpp` tests. Those tests `PASS` when compiled with `gcc`, which happens because `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 `_ReturnAddres`, 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 funtion 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`.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D91608
Files:
compiler-rt/include/sanitizer/common_interface_defs.h
compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
compiler-rt/test/sanitizer_common/TestCases/symbolize_pc.cpp
compiler-rt/test/sanitizer_common/TestCases/symbolize_pc_inline.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91608.305715.patch
Type: text/x-patch
Size: 5493 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201117/c60307a5/attachment.bin>
More information about the llvm-commits
mailing list