llvm-project/compiler-rt/test/sanitizer_common/TestCases
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
..
Darwin Fix PR26608: Make sanitizer_common tests more portable. 2016-02-17 21:00:50 +00:00
Linux [sanitizers] Update sanitizers test to better match glibc internals 2016-10-05 07:13:42 +00:00
Posix Fix test for Darwin: ASAN is calling abort by default on Darwin, which not detects as a crash 2016-05-31 20:09:56 +00:00
corelimit.cc [TSan] Initialize flags as early as possible. Disables back coredump, accidentally enabled in r215479. Add a test. 2014-08-15 19:53:51 +00:00
fopen_nullptr.c [asan] fix fopen interceptor to not crash if path is NULL 2015-12-21 19:22:26 +00:00
malloc_hook.cc [sanitizers] introduce yet another API function: __sanitizer_install_malloc_and_free_hooks 2016-06-16 20:06:06 +00:00
options-help.cc [Sanitizer] Test churn: use %env_tool_opts in sanitizer_common lit tests. 2015-08-26 19:29:07 +00:00
options-include.cc Fix PR26608: Make sanitizer_common tests more portable. 2016-02-17 21:00:50 +00:00
options-invalid.cc [Sanitizer] Test churn: use %env_tool_opts in sanitizer_common lit tests. 2015-08-26 19:29:07 +00:00
print-stack-trace.cc [sanitizer-common] Use @LINE in test. 2016-03-07 13:44:20 +00:00
pthread_mutexattr_get.cc Remove ARM XFAIL from passing test 2014-06-24 16:58:59 +00:00
strcasestr.c [sanitizer] More string interceptors: strstr, strcasestr, strspn, strcspn, strpbrk. 2015-05-28 09:24:33 +00:00
strcspn.c [sanitizer] More string interceptors: strstr, strcasestr, strspn, strcspn, strpbrk. 2015-05-28 09:24:33 +00:00
strnlen.c [sanitizer] Add strnlen to the common interceptors 2016-03-23 21:24:28 +00:00
strpbrk.c [sanitizer] More string interceptors: strstr, strcasestr, strspn, strcspn, strpbrk. 2015-05-28 09:24:33 +00:00
strspn.c [sanitizer] More string interceptors: strstr, strcasestr, strspn, strcspn, strpbrk. 2015-05-28 09:24:33 +00:00
strstr.c [sanitizer] More string interceptors: strstr, strcasestr, strspn, strcspn, strpbrk. 2015-05-28 09:24:33 +00:00
symbolize_pc.cc [sanitizer] rename __sanitizer_symbolize_data to __sanitizer_symbolize_global (to avoid conflict with another definition) 2016-09-19 14:18:16 +00:00