Skip to content

Commit f0bd598

Browse files
committed
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 ------------------------------------------------------------------------ llvm-svn: 362024
1 parent e31804d commit f0bd598

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

compiler-rt/test/builtins/Unit/compiler_rt_logb_test.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ double cases[] = {
3737
};
3838

3939
int main() {
40+
// Do not the run the compiler-rt logb test case if using GLIBC version
41+
// < 2.23. Older versions might not compute to the same value as the
42+
// compiler-rt value.
43+
#if !defined(__GLIBC__) || (defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 23))
4044
const unsigned N = sizeof(cases) / sizeof(cases[0]);
4145
unsigned i;
4246
for (i = 0; i < N; ++i) {
@@ -58,6 +62,9 @@ int main() {
5862
if (test__compiler_rt_logb(fromRep(signBit ^ x))) return 1;
5963
x >>= 1;
6064
}
65+
#else
66+
printf("skipped\n");
67+
#endif
6168

6269
return 0;
6370
}

0 commit comments

Comments
 (0)