X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Ffmaxf.c;h=9268786052a72339114a6fbc860f5661809d7a74;hb=2146d5e12aa52cb97f0a151e2611967f0653a07a;hp=febb8a71d3297e8600fdeaef603be5ad7261f431;hpb=457b0dbfc1d72080f6ba9fe47cd712e0f090732a;p=libc-test diff --git a/src/math/fmaxf.c b/src/math/fmaxf.c index febb8a7..9268786 100644 --- a/src/math/fmaxf.c +++ b/src/math/fmaxf.c @@ -9,6 +9,7 @@ static struct ff_f t[] = { int main(void) { + #pragma STDC FENV_ACCESS ON float y; float d; int e, i, err = 0; @@ -16,9 +17,14 @@ int main(void) for (i = 0; i < sizeof t/sizeof *t; i++) { p = t + i; - setupfenv(p->r); + + if (p->r < 0) + continue; + fesetround(p->r); + feclearexcept(FE_ALL_EXCEPT); y = fmaxf(p->x, p->x2); - e = getexcept(); + e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); + if (!checkexcept(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s fmaxf(%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e));