summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/builtins/Unit/compiler_rt_logb_test.c
diff options
context:
space:
mode:
authorAmy Kwan <amy.kwan1@ibm.com>2019-04-30 20:09:00 +0000
committerAmy Kwan <amy.kwan1@ibm.com>2019-04-30 20:09:00 +0000
commit31dbbf1df911b2850f9641e2626f5e65846153e1 (patch)
treea94a8adfa7d34d5d03ecb29971c698b142b79e71 /compiler-rt/test/builtins/Unit/compiler_rt_logb_test.c
parent397ca2f22eeb9dfb3837944212f59514908b3304 (diff)
downloadbcm5719-llvm-31dbbf1df911b2850f9641e2626f5e65846153e1.tar.gz
bcm5719-llvm-31dbbf1df911b2850f9641e2626f5e65846153e1.zip
[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 llvm-svn: 359606
Diffstat (limited to 'compiler-rt/test/builtins/Unit/compiler_rt_logb_test.c')
-rw-r--r--compiler-rt/test/builtins/Unit/compiler_rt_logb_test.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler-rt/test/builtins/Unit/compiler_rt_logb_test.c b/compiler-rt/test/builtins/Unit/compiler_rt_logb_test.c
index cf2a04e4db7..47412532527 100644
--- a/compiler-rt/test/builtins/Unit/compiler_rt_logb_test.c
+++ b/compiler-rt/test/builtins/Unit/compiler_rt_logb_test.c
@@ -36,6 +36,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) {
@@ -57,6 +61,9 @@ int main() {
if (test__compiler_rt_logb(fromRep(signBit ^ x))) return 1;
x >>= 1;
}
+#else
+ printf("skipped\n");
+#endif
return 0;
}
OpenPOWER on IntegriCloud