Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix bug-getcontext test
  • Loading branch information
Andreas Schwab committed Jul 16, 2012
1 parent dd31893 commit d0cd7d0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2012-07-16 Andreas Schwab <schwab@linux-m68k.org>

* stdlib/bug-getcontext.c (do_test): Don't test FE_ALL_EXCEPT in
preprocessor. Test for each exception mask separately.

2012-07-16 Andreas Jaeger <aj@suse.de>

* po/ru.po: Update from translation team.
Expand Down
25 changes: 20 additions & 5 deletions stdlib/bug-getcontext.c
Expand Up @@ -9,10 +9,25 @@
static int
do_test (void)
{
#if FE_ALL_EXCEPT == 0
printf("Skipping test; no support for FP exceptions.\n");
#else
int except_mask = FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW;
if (FE_ALL_EXCEPT == 0)
{
printf("Skipping test; no support for FP exceptions.\n");
return 0;
}

int except_mask = 0;
#ifdef FE_DIVBYZERO
except_mask |= FE_DIVBYZERO;
#endif
#ifdef FE_INVALID
except_mask |= FE_INVALID;
#endif
#ifdef FE_OVERFLOW
except_mask |= FE_OVERFLOW;
#endif
#ifdef FE_UNDERFLOW
except_mask |= FE_UNDERFLOW;
#endif
int status = feenableexcept (except_mask);

except_mask = fegetexcept ();
Expand Down Expand Up @@ -44,7 +59,7 @@ do_test (void)

printf("\nAt end fegetexcept() returned %d, expected: %d.\n",
mask, except_mask);
#endif

return 0;
}

Expand Down

0 comments on commit d0cd7d0

Please sign in to comment.