Commit graph

12 commits

Author SHA1 Message Date
Elliott Hughes
017bd9882a riscv64: fix <fenv.h> tests.
Group riscv64 with arm/arm64, and allow for the fact that there's no
FE_DENORMAL in the riscv64 spec.

Test: fenv.*
Change-Id: Ibf188bcedffd092a7ef1555fa2762e249e1f9845
2022-10-18 23:47:28 +00:00
Elliott Hughes
d25a5e73f8 Add an explicit test that fegetenv()/fesetenv() includes the rounding mode.
I haven't found this explicitly stated anywhere, but it's how our
existing implementations behave, and it seems obviously implied by
the word "entire" in POSIX's claim that fenv_t "Represents the entire
floating-point environment".

Test: treehugger
Change-Id: Ic8fc993775b4ded57dc88766a7d24d0954f3b56d
2022-10-14 20:55:23 +00:00
Colin Cross
4c5595c968 Replace local MUSL define with global ANDROID_HOST_MUSL
Bug: 190084016
Test: m USE_HOST_MUSL=true bionic-unit-tests-glibc
Change-Id: I56b23576cb24912112d2ae56d8ecc2e3716982fe
2021-08-16 16:44:24 -07:00
Colin Cross
7da20341e9 Build bionic unit tests for musl
Modify bionic unit tests that are built for glibc so that they also
build against musl.  They don't all pass though:

With glibc:
 2 SLOW TESTS
 4 TIMEOUT TESTS
313 FAILED TESTS
  YOU HAVE 2 DISABLED TESTS

With musl:
11 SLOW TESTS
11 TIMEOUT TESTS
363 FAILED TESTS
  YOU HAVE 2 DISABLED TESTS

Bug: 190084016
Test: m bionic-unit-tests-glibc with musl
Test: atest bionic-unit-tests-static
Test: atest --host bionic-unit-tests-glibc with glibc
Change-Id: I79b6eab04fed3cc4392450df5eef2579412edfe1
2021-08-12 11:13:11 -07:00
Elliott Hughes
6249f9b44e Don't involve debuggerd in a SIGFPE test.
We just want to check that SIGFPE is raised, not try to "debug" this
expected behavior.

Bug: http://b/180605583
Test: check logs
Change-Id: I11571e02c4608570e0d406adeabc36186c5bb107
2021-02-18 17:25:07 -08:00
Elliott Hughes
7cda75f1d3 Add DoNotOptimize and use it in tests.
Bug: http://b/148307629
Test: treehugger
Change-Id: I3b1726ae55116f6553ea38fe163abdde179c21f0
2020-10-22 13:22:35 -07:00
Chih-Hung Hsieh
7d66bf9d90 Fix new clang compiler warning
Bug: 148287059
Test: make
Change-Id: I24972955454fa40fc565744e2caaaa636caa44c2
2020-01-24 14:28:45 -08:00
Elliott Hughes
71ba5899ae Rewrite system(3) to use posix_spawn(3).
We saw crashes from pthread_exit+debuggerd on LP32
(https://issuetracker.google.com/72291624), and it seems like the
equivalent problem should exist with system(3). I fixed posix_spawn(3)
as part of that bug, so the easiest fix is probably to reuse that.

Bug: http://b/72470344
Test: ran tests
Change-Id: I05f838706f2b4a14ac3ee21292833e6c8579b0d4
2018-03-05 17:20:12 -08:00
Elliott Hughes
b6c7f6e595 Fix arm/arm64 <fenv.h> to match current reality.
ARM stopped supporting enabling of FP exceptions years ago.

Bug: http://b/68832485
Test: ran tests
Change-Id: I8450baa78e04d994c352180975b0a1ecd5a9f662
2017-11-03 16:46:32 -07:00
Elliott Hughes
18a1957444 Add basic tests for the remaining 9 libm <fenv.h> functions.
It seems that feenableexcept/fegetexcept are lying to us on arm/arm64
because the hardware doesn't actually support such functionality. When
I get confirmation of that from ARM I'll fix the <fenv.h> implementation
correspondingly --- writing to/reading from reserved FP control register
bits as we currently do doesn't seem like the best of ideas.

Bug: http://b/31742322
Test: ran tests on arm/arm64/x86/x86-64
Change-Id: If78f83ddab221b568fa168c3364a7ae95c024983
2017-11-02 16:18:43 -07:00
Elliott Hughes
a0ee07829a Upgrade libm.
This brings us up to date with FreeBSD HEAD, fixes various bugs, unifies
the set of functions we support on ARM, MIPS, and x86, fixes "long double",
adds ISO C99 support, and adds basic unit tests.

It turns out that our "long double" functions have always been broken
for non-normal numbers. This patch fixes that by not using the upstream
implementations and just forwarding to the regular "double" implementation
instead (since "long double" on Android is just "double" anyway, which is
what BSD doesn't support).

All the tests pass on ARM, MIPS, and x86, plus glibc on x86-64.

Bug: 3169850
Bug: 8012787
Bug: https://code.google.com/p/android/issues/detail?id=6697
Change-Id: If0c343030959c24bfc50d4d21c9530052c581837
2013-02-01 14:51:19 -08:00
Elliott Hughes
90e10d41c4 Rewrite <fenv.h> for ARM.
The old code was one big no-op.

Bug: http://code.google.com/p/android/issues/detail?id=38196
Change-Id: I201a6ffa477385b2629f45e8c948bdfbd47b5bf1
2012-11-05 08:50:19 -08:00