api: add stdbool and stddef
[libc-test] / src / math / gen / template / l_li.c
index 1bfa9de..32c6a0e 100644 (file)
@@ -12,6 +12,7 @@ HEADERS
 
 int main(void)
 {
+       #pragma STDC FENV_ACCESS ON
        int yi;
        long double y;
        float d;
@@ -20,9 +21,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 = ___(p->x, &yi);
-               e = getexcept();
+               e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
+
                if (!checkexcept(e, p->e, p->r)) {
                        printf("%s:%d: bad fp exception: %s ___(%La)=%La,%lld, want %s",
                                p->file, p->line, rstr(p->r), p->x, p->y, p->i, estr(p->e));