llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux
Diana Picus 47cf72c34c [sanitizers] Update sanitizers test to better match glibc internals
Reapply 282061.

One of the tests relying on sem_t's layout gets the wrong value for versions of
glibc newer than 2.21 on platforms that don't have 64-bit atomics (e.g. ARM).

This commit fixes the test to work with:
* versions of glibc >= 2.21 on platforms with 64-bit atomics: unchanged
* versions of glibc >= 2.21 on platforms without 64-bit atomics: the semaphore
value is shifted by SEM_VALUE_SHIFT (which is set to 1 in glibc's internal
headers)
* versions of glibc < 2.21: unchanged

The logic is complicated a bit by the fact that the sanitizers always pick the
oldest version of the symbol available in glibc, which creates discrepancies
between old platforms which contain several versions od the sem_init symbol, and
newer platforms which contain only one.

See the glibc 2.23 sources:
* sysdeps/nptl/internaltypes.h (struct new_sem for glibc >= 2.21 and
                                struct old_sem for glibc < 2.21)
* nptl/sem_getvalue.c

This was uncovered on one of the new buildbots that we are trying to move to
production.

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

llvm-svn: 283299
2016-10-05 07:13:42 +00:00
..
abort_on_error.cc Fix PR26608: Make sanitizer_common tests more portable. 2016-02-17 21:00:50 +00:00
aligned_alloc.c [sanitizer] support c11 aligned_alloc, Linux only for now 2014-07-04 07:30:34 +00:00
assert.cc [Sanitizer] Test churn: use %env_tool_opts in sanitizer_common lit tests. 2015-08-26 19:29:07 +00:00
clock_gettime.c Add regression test for PR15823 2014-08-18 22:11:14 +00:00
closedir.c [tsan] don't crash on closedir(0) 2016-01-08 22:48:19 +00:00
decorate_proc_maps.cc [sanitizer_common tests] Make Darwin a Posix system and bring the stable-runtime definition from ASan tests. 2016-03-10 18:46:23 +00:00
fpe.cc [tests] Remove "supported-target" in favor of "target-arch" lit features. 2016-02-23 01:58:56 +00:00
getpwnam_r_invalid_user.cc [Sanitizer] Fix getpwnam test on ppc64le Fedora 21. 2015-04-23 22:20:33 +00:00
hard_rss_limit_mb_test.cc [Sanitizer] Test churn: use %env_tool_opts in sanitizer_common lit tests. 2015-08-26 19:29:07 +00:00
ill.cc [tests] Remove "supported-target" in favor of "target-arch" lit features. 2016-02-23 01:58:56 +00:00
lit.local.cfg
mlock_test.cc [sanitizer] move mlock interceptor from asan/tsan/msan to common; no functionality change intended 2014-08-25 20:57:59 +00:00
open_memstream.cc [tests] Remove "supported-target" in favor of "target-arch" lit features. 2016-02-23 01:58:56 +00:00
ptrace.cc [sanitizer] [SystemZ] Add ptrace support bits. 2016-04-26 10:41:30 +00:00
recv_msg_trunc.cc [asan] Don't raise false alarm to recv/recvfrom when MSG_TRUNC is present. 2016-05-17 07:38:27 +00:00
sched_getparam.cc [sanitizer] Move sched_getparam test under Linux/. 2015-01-22 15:34:50 +00:00
sem_init_glibc.cc [sanitizers] Update sanitizers test to better match glibc internals 2016-10-05 07:13:42 +00:00
signal_segv_handler.cc asan: fix a test 2015-07-19 21:44:49 +00:00
soft_rss_limit_mb_test.cc [Sanitizer] Test churn: use %env_tool_opts in sanitizer_common lit tests. 2015-08-26 19:29:07 +00:00
timerfd.cc [sanitizer] Intercept timerfd_settime, timerfd_gettime. 2014-08-07 14:21:42 +00:00
weak_hook_test.cc [sanitizers] add interceptor for memmem; add weak hooks for strncasecmp, strcasecmp, strstr, strcasestr, memmem 2016-07-15 21:28:58 +00:00