Improve signal handling and math

- Polyfill ucontext_t on FreeBSD/OpenBSD/NetBSD
- Add tests confirming signals can edit CPU state
- Work towards supporting ZIP filesystem on bare metal
- Add more tinymath unit tests for POSIX conformance
- Add X87 and SSE status flags to crash report
- Fix some bugs in blinkenlights
- Fix llvm build breakage
This commit is contained in:
Justine Tunney 2021-02-25 18:30:17 -08:00
parent cdc54ea1fd
commit 40291c9db3
109 changed files with 2316 additions and 520 deletions

View file

@ -28,3 +28,28 @@ TEST(atan2l, test) {
EXPECT_STREQ("-2.95", gc(xasprintf("%.2f", atan2(b, a))));
EXPECT_STREQ("-2.95", gc(xasprintf("%.2Lf", atan2l(b, a))));
}
TEST(atan2, testSpecialCases) {
ASSERT_STREQ("NAN", gc(xdtoa(atan2(NAN, 0))));
ASSERT_STREQ("NAN", gc(xdtoa(atan2(0, NAN))));
ASSERT_STREQ("0", gc(xdtoa(atan2(+0., +0.))));
ASSERT_STREQ("0", gc(xdtoa(atan2(+0., +1.))));
ASSERT_STREQ("0", gc(xdtoa(atan2(+0., +2.))));
ASSERT_STREQ("0", gc(xdtoa(atan2(1, INFINITY))));
ASSERT_STREQ("3.141592653589793", gc(xdtoal(atan2(+0., -0.))));
ASSERT_STREQ("3.141592653589793", gc(xdtoal(atan2(+0., -1.))));
ASSERT_STREQ("3.141592653589793", gc(xdtoal(atan2(+0., -2.))));
ASSERT_STREQ("-1.570796326794897", gc(xdtoal(atan2(-1., -0.))));
ASSERT_STREQ("-1.570796326794897", gc(xdtoal(atan2(-1., +0.))));
ASSERT_STREQ("-1.570796326794897", gc(xdtoal(atan2(-2., -0.))));
ASSERT_STREQ("-1.570796326794897", gc(xdtoal(atan2(-2., +0.))));
ASSERT_STREQ("1.570796326794897", gc(xdtoal(atan2(+1., -0.))));
ASSERT_STREQ("1.570796326794897", gc(xdtoal(atan2(+1., +0.))));
ASSERT_STREQ("1.570796326794897", gc(xdtoal(atan2(+2., -0.))));
ASSERT_STREQ("1.570796326794897", gc(xdtoal(atan2(+2., +0.))));
ASSERT_STREQ("1.570796326794897", gc(xdtoal(atan2(INFINITY, 1))));
ASSERT_STREQ("1.570796326794897", gc(xdtoal(atan2(INFINITY, -1))));
ASSERT_STREQ("3.141592653589793", gc(xdtoal(atan2(1, -INFINITY))));
ASSERT_STREQ("2.356194490192345", gc(xdtoal(atan2(INFINITY, -INFINITY))));
ASSERT_STREQ(".7853981633974483", gc(xdtoal(atan2(INFINITY, INFINITY))));
}