X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmath%2Flround.c;h=92835b18717293610a9602aebf0eb3d21f9b641a;hb=b55b931794bff9e88a3443daa8404c74f7f1d17c;hp=7041288aef7e64a5e2b2ba8ad0f3f6801777d5cf;hpb=f3f0ff4782fc90bd0f3e48fd541ee431f76aaed1;p=libc-test diff --git a/src/math/lround.c b/src/math/lround.c index 7041288..92835b1 100644 --- a/src/math/lround.c +++ b/src/math/lround.c @@ -1,6 +1,6 @@ #include #include -#include "util.h" +#include "mtest.h" static struct d_i t[] = { #include "sanity/lround.h" @@ -25,13 +25,13 @@ int main(void) yi = lround(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexcept(e, p->e, p->r) && (e|INEXACT) != p->e) { printf("%s:%d: bad fp exception: %s lround(%a)=%lld, want %s", p->file, p->line, rstr(p->r), p->x, p->i, estr(p->e)); printf(" got %s\n", estr(e)); err++; } - if (yi != p->i) { + if (!(p->e&INVALID) && yi != p->i) { printf("%s:%d: %s lround(%a) want %lld got %lld\n", p->file, p->line, rstr(p->r), p->x, p->i, yi); err++;