diff options
author | Tom Stellard <tstellar@redhat.com> | 2019-05-29 20:16:38 +0000 |
---|---|---|
committer | Tom Stellard <tstellar@redhat.com> | 2019-05-29 20:16:38 +0000 |
commit | 1593740758bade75854f8b6465bc447064f8ed38 (patch) | |
tree | 6f7c1dce7f4da1c6af389829ae1f98bffe1b8d5a | |
parent | 94ed517a442fd733ade35679142f1abd3fdb9217 (diff) | |
download | compiler-rt-1593740758bade75854f8b6465bc447064f8ed38.tar.gz |
Merging r359606:
------------------------------------------------------------------------
r359606 | amyk | 2019-04-30 13:09:00 -0700 (Tue, 30 Apr 2019) | 12 lines
[compiler-rt][builtins][sanitizers] Update compiler-rt test cases for
compatibility with system's toolchain
This patch aims to:
- Guard ompiler-rt/test/builtins/Unit/compiler_rt_logb_test.c with macros, so
the test runs on GLIBC versions >= 2.23. This is because the test relies on
comparing its computed values to libm. Oolder versions might not compute to the
same value as the compiler-rt value.
- Update compiler-rt/test/sanitizer_common/TestCases/Posix/getpw_getgr.cc
so that std::string is not used, since false positives may be detected.
Differential Revision: https://reviews.llvm.org/D60644
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_80@362024 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/builtins/Unit/compiler_rt_logb_test.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/builtins/Unit/compiler_rt_logb_test.c b/test/builtins/Unit/compiler_rt_logb_test.c index 796765980..962588131 100644 --- a/test/builtins/Unit/compiler_rt_logb_test.c +++ b/test/builtins/Unit/compiler_rt_logb_test.c @@ -37,6 +37,10 @@ double cases[] = { }; int main() { + // Do not the run the compiler-rt logb test case if using GLIBC version + // < 2.23. Older versions might not compute to the same value as the + // compiler-rt value. +#if !defined(__GLIBC__) || (defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 23)) const unsigned N = sizeof(cases) / sizeof(cases[0]); unsigned i; for (i = 0; i < N; ++i) { @@ -58,6 +62,9 @@ int main() { if (test__compiler_rt_logb(fromRep(signBit ^ x))) return 1; x >>= 1; } +#else + printf("skipped\n"); +#endif return 0; } |