[sanitizers][test] Test sanitizer_common and ubsan_minimal on Solaris
authorRainer Orth <ro@gcc.gnu.org>
Fri, 20 Nov 2020 13:06:25 +0000 (14:06 +0100)
committerRainer Orth <ro@gcc.gnu.org>
Fri, 20 Nov 2020 13:06:25 +0000 (14:06 +0100)
commit03d593dd7e6de269381ac71d0269a207f4dd1eeb
treef5e77ef3fb2e5cd07926f75ebda102b44b24dd10
parenta89e55ca572ee25f6e6104d76a7dcbd6f07ebbe3
[sanitizers][test] Test sanitizer_common and ubsan_minimal on Solaris

During the initial Solaris sanitizer port, I missed to enable the
`sanitizer_common` and `ubsan_minimal` testsuites.  This patch fixes this,
correcting a few unportabilities:

- `Posix/getpass.cpp` failed to link since Solaris lacks `libutil`.
  Omitting the library lets the test `PASS`, but I thought adding `%libutil`
  along the lines of `%librt` to be overkill.
- One subtest of `Posix/getpw_getgr.cpp` is disabled because Solaris
  `getpwent_r` has a different signature than expected.
- `/dev/null` is a symlink on Solaris.
- XPG7 specifies that `uname` returns a non-negative value on success.

Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D91606
compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
compiler-rt/test/sanitizer_common/CMakeLists.txt
compiler-rt/test/sanitizer_common/TestCases/Posix/fgetln.cpp
compiler-rt/test/sanitizer_common/TestCases/Posix/getpass.cpp
compiler-rt/test/sanitizer_common/TestCases/Posix/getpw_getgr.cpp
compiler-rt/test/sanitizer_common/TestCases/Posix/lstat.cpp
compiler-rt/test/sanitizer_common/TestCases/Posix/uname.c
compiler-rt/test/sanitizer_common/lit.common.cfg.py
compiler-rt/test/ubsan_minimal/lit.common.cfg.py