X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fsanity.c;h=9550a707fe5ea9c9c3496b436adb2d50e07dd41a;hb=9d3ffa45089292491306c31e64757e44f90fc8f8;hp=e765987d5ac38ccc8784b4e0ea68f16e294591f8;hpb=0c7d465f8b04e9db61c2c9a32510799c19ec0503;p=libc-test diff --git a/src/math/sanity.c b/src/math/sanity.c index e765987..9550a70 100644 --- a/src/math/sanity.c +++ b/src/math/sanity.c @@ -21,15 +21,21 @@ static int checkl(long double a, long double b) } #define D(fx, y) do{ \ - double yy = fx; \ + volatile double yy = fx; \ + volatile long double yl = fx; \ if (!check(yy, y)) \ error("%s got %a = %.21e want %a = %.21e\n", #fx, yy, yy, y, y); \ + if (yy != yl) \ + error("float-store issue: (double)%s = %a (long double)%s = %La\n", #fx, yy, #fx, yl); \ }while(0) #define F(fx, y) do{ \ - float yy = fx; \ + volatile float yy = fx; \ + volatile long double yl = fx; \ if (!checkf(yy, y)) \ error("%s got %a = %.21e want %a = %.21e\n", #fx, yy, yy, y, y); \ + if (yy != yl) \ + error("float-store issue: (float)%s = %a (long double)%s = %La\n", #fx, yy, #fx, yl); \ }while(0) #define L(fx, y) do{ \ @@ -56,7 +62,7 @@ static int checkl(long double a, long double b) error("%s got %lld want %lld\n", #fx, yy, y); \ }while(0) -int test_math_sanity() +void test_math_sanity() { int i; double q; @@ -248,6 +254,4 @@ D(y1(0.7), -0x1.1a6e956728d35p+0); F(y1f(0.7f), -0x1.1a6e96p+0); D(yn(2, 0.7), -0x1.7b11b25df166ep+1); F(ynf(2, 0.7f), -0x1.7b11b4p+1); - - return 0; }