llvm-project/compiler-rt
Rainer Orth d83c9005cf [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
2022-02-01 22:33:56 +01:00
..
cmake [cmake] Partially deduplicate `{llvm,compiler_rt}_check_linker_flag` for runtime libs and llvm 2022-01-29 06:07:24 +00:00
docs Prepare Compiler-RT for GnuInstallDirs, matching libcxx, document all 2021-07-13 15:21:41 +00:00
include [sanitizer_common][test] Enable tests on SPARC 2022-02-01 22:33:56 +01:00
lib [sanitizer_common][test] Enable tests on SPARC 2022-02-01 22:33:56 +01:00
test [sanitizer_common][test] Enable tests on SPARC 2022-02-01 22:33:56 +01:00
tools [GWP-ASan] Add inbuilt options parser. 2021-01-15 12:57:05 -08:00
unittests [test] Fix asan dynamic unit tests with per-target runtime dirs 2021-10-14 16:47:25 -04:00
utils [compiler-rt] NFC: Fix trivial typo 2021-09-04 14:12:58 +05:30
www [compiler-rt] Document that builtins is known to work on OpenBSD. 2021-09-07 04:25:12 -04:00
.clang-tidy NFC: .clang-tidy: Inherit configs from parents to improve maintainability 2021-06-08 08:25:59 -07:00
.gitignore
CMakeLists.txt [CMake] Use generator expression to get in-tree libc++ path 2022-01-26 14:12:48 -08:00
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
README.txt

README.txt

Compiler-RT
================================

This directory and its subdirectories contain source code for the compiler
support routines.

Compiler-RT is open source software. You may freely distribute it under the
terms of the license agreement found in LICENSE.txt.

================================