Fix `compiler_rt_logbf_test.c` test failure for Builtins-i386-darwin test suite.
authorDan Liew <dan@su-root.co.uk>
Tue, 8 Oct 2019 20:06:01 +0000 (20:06 +0000)
committerDan Liew <dan@su-root.co.uk>
Tue, 8 Oct 2019 20:06:01 +0000 (20:06 +0000)
commit196eae533b091243e052e54895ebcd7ca287ed54
tree934b13f91593a8f16f74bd1db7e2e7f69fe45e8c
parentb56e3a1723e3e390f4b73bb466a3f6cd91458ca2
Fix `compiler_rt_logbf_test.c` test failure for Builtins-i386-darwin test suite.

Summary:
It seems that compiler-rt's implementation and Darwin
libm's implementation of `logbf()` differ when given a NaN
with raised sign bit. Strangely this behaviour only happens with
i386 Darwin libm. For x86_64 and x86_64h the existing compiler-rt
implementation matched Darwin libm.

To workaround this the `compiler_rt_logbf_test.c` has been modified
to do a comparison on the `fp_t` type and if that fails check if both
values are NaN. If both values are NaN they are equivalent and no
error needs to be raised.

rdar://problem/55565503

Reviewers: rupprecht, scanon, compnerd, echristo
Subscribers: #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D67999

llvm-svn: 374109
compiler-rt/test/builtins/Unit/compiler_rt_logbf_test.c