summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-06-09 23:18:35 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-06-09 23:18:35 +0000
commite7baf46b860fca249c98ba905150544cb49e6b1f (patch)
treee1390ee958406d4690f42a7ffb73ed2241c1c761
parent4779a11a3dfa7314b3cb3998b1f9172c40dfc5f6 (diff)
parent18b17e97757a59718a23f8128dfc91c016df08b1 (diff)
downloadbionic-e7baf46b860fca249c98ba905150544cb49e6b1f.zip
bionic-e7baf46b860fca249c98ba905150544cb49e6b1f.tar.gz
bionic-e7baf46b860fca249c98ba905150544cb49e6b1f.tar.bz2
Merge "Add a regression test for two libm bugs we didn't have."
-rw-r--r--tests/math_test.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/math_test.cpp b/tests/math_test.cpp
index b0d541a..b4f5b14 100644
--- a/tests/math_test.cpp
+++ b/tests/math_test.cpp
@@ -1295,3 +1295,18 @@ TEST(math, frexpf_public_bug_6697) {
float fr = frexpf(14.1f, &exp);
ASSERT_FLOAT_EQ(14.1f, scalbnf(fr, exp));
}
+
+TEST(math, exp2_STRICT_ALIGN_OpenBSD_bug) {
+ // OpenBSD/x86's libm had a bug here, but it was already fixed in FreeBSD:
+ // http://svnweb.FreeBSD.org/base/head/lib/msun/src/math_private.h?revision=240827&view=markup
+ ASSERT_DOUBLE_EQ(5.0, exp2(log2(5)));
+ ASSERT_FLOAT_EQ(5.0f, exp2f(log2f(5)));
+ ASSERT_DOUBLE_EQ(5.0L, exp2l(log2l(5)));
+}
+
+TEST(math, nextafterl_OpenBSD_bug) {
+ // OpenBSD/x86's libm had a bug here.
+ ASSERT_TRUE(nextafter(1.0, 0.0) - 1.0 < 0.0);
+ ASSERT_TRUE(nextafterf(1.0f, 0.0f) - 1.0f < 0.0f);
+ ASSERT_TRUE(nextafterl(1.0L, 0.0L) - 1.0L < 0.0L);
+}