12 if (FE_ALL_EXCEPT
== 0)
14 printf("Skipping test; no support for FP exceptions.\n");
20 except_mask
|= FE_DIVBYZERO
;
23 except_mask
|= FE_INVALID
;
26 except_mask
|= FE_OVERFLOW
;
29 except_mask
|= FE_UNDERFLOW
;
31 int status
= feenableexcept (except_mask
);
33 except_mask
= fegetexcept ();
34 if (except_mask
== -1)
36 printf("\nBefore getcontext(): fegetexcept returned: %d\n",
42 status
= getcontext(&ctx
);
45 printf("\ngetcontext failed, errno: %d.\n", errno
);
49 printf ("\nDone with getcontext()!\n");
52 int mask
= fegetexcept ();
53 if (mask
!= except_mask
)
55 printf("\nAfter getcontext(): fegetexcept returned: %d, expected: %d.\n",
60 printf("\nAt end fegetexcept() returned %d, expected: %d.\n",
66 #define TEST_FUNCTION do_test ()
67 #include "../test-skeleton.c"