Get LIBC_TESTLIB building on AARCH64

This commit is contained in:
Justine Tunney 2023-05-11 19:56:33 -07:00
parent 95fab334e4
commit 5e2f7f7ced
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
46 changed files with 975 additions and 1174 deletions

View file

@ -22,32 +22,32 @@
#include "libc/x/x.h"
#include "libc/x/xasprintf.h"
#define asinhl(x) asinhl(VEIL("t", (long double)(x)))
#define asinh(x) asinh(VEIL("x", (double)(x)))
#define asinhf(x) asinhf(VEIL("x", (float)(x)))
double _asinh(double) asm("asinh");
float _asinhf(float) asm("asinhf");
long double _asinhl(long double) asm("asinhl");
TEST(asinh, test) {
EXPECT_STREQ(".481211825059603", _gc(xdtoa(asinh(+.5))));
EXPECT_STREQ("-.481211825059603", _gc(xdtoa(asinh(-.5))));
EXPECT_STREQ("0", _gc(xdtoa(asinh(0))));
EXPECT_STREQ("NAN", _gc(xdtoa(asinh(NAN))));
EXPECT_STREQ("INFINITY", _gc(xdtoa(asinh(INFINITY))));
EXPECT_STREQ(".481211825059603", _gc(xdtoa(_asinh(+.5))));
EXPECT_STREQ("-.481211825059603", _gc(xdtoa(_asinh(-.5))));
EXPECT_STREQ("0", _gc(xdtoa(_asinh(0))));
EXPECT_STREQ("NAN", _gc(xdtoa(_asinh(NAN))));
EXPECT_STREQ("INFINITY", _gc(xdtoa(_asinh(INFINITY))));
EXPECT_STREQ("-2.1073424255447e-08",
_gc(xasprintf("%.15g", asinh(-2.1073424255447e-08))));
_gc(xasprintf("%.15g", _asinh(-2.1073424255447e-08))));
}
TEST(asinhf, test) {
EXPECT_STREQ(".481212", _gc(xdtoaf(asinhf(+.5))));
EXPECT_STREQ("-.481212", _gc(xdtoaf(asinhf(-.5))));
EXPECT_STREQ("0", _gc(xdtoaf(asinhf(0))));
EXPECT_STREQ("NAN", _gc(xdtoaf(asinhf(NAN))));
EXPECT_STREQ("INFINITY", _gc(xdtoaf(asinhf(INFINITY))));
EXPECT_STREQ(".481212", _gc(xdtoaf(_asinhf(+.5))));
EXPECT_STREQ("-.481212", _gc(xdtoaf(_asinhf(-.5))));
EXPECT_STREQ("0", _gc(xdtoaf(_asinhf(0))));
EXPECT_STREQ("NAN", _gc(xdtoaf(_asinhf(NAN))));
EXPECT_STREQ("INFINITY", _gc(xdtoaf(_asinhf(INFINITY))));
}
TEST(asinhl, test) {
EXPECT_STREQ(".4812118250596034", _gc(xdtoal(asinhl(+.5))));
EXPECT_STREQ("-.4812118250596034", _gc(xdtoal(asinhl(-.5))));
EXPECT_STREQ("0", _gc(xdtoal(asinhl(0))));
EXPECT_STREQ("NAN", _gc(xdtoal(asinhl(NAN))));
EXPECT_STREQ("INFINITY", _gc(xdtoal(asinhl(INFINITY))));
EXPECT_STREQ(".4812118250596034", _gc(xdtoal(_asinhl(+.5))));
EXPECT_STREQ("-.4812118250596034", _gc(xdtoal(_asinhl(-.5))));
EXPECT_STREQ("0", _gc(xdtoal(_asinhl(0))));
EXPECT_STREQ("NAN", _gc(xdtoal(_asinhl(NAN))));
EXPECT_STREQ("INFINITY", _gc(xdtoal(_asinhl(INFINITY))));
}