Add bho_IN locale
[glibc.git] / stdlib / bug-getcontext.c
blob745aa1f2072056bd61da9420b14bd4a83a535000
1 /* BZ 12420 */
3 #include <errno.h>
4 #include <fenv.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <ucontext.h>
9 static int
10 do_test (void)
12 int except_mask = FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW;
13 int status = feenableexcept (except_mask);
15 except_mask = fegetexcept ();
16 if (except_mask == -1)
18 printf("\nBefore getcontext(): fegetexcept returned: %d\n",
19 except_mask);
20 return 1;
23 ucontext_t ctx;
24 status = getcontext(&ctx);
25 if (status)
27 printf("\ngetcontext failed, errno: %d.\n", errno);
28 return 1;
31 printf ("\nDone with getcontext()!\n");
32 fflush (NULL);
34 int mask = fegetexcept ();
35 if (mask != except_mask)
37 printf("\nAfter getcontext(): fegetexcept returned: %d, expected: %d.\n",
38 mask, except_mask);
39 return 1;
42 printf("\nAt end fegetexcept() returned %d, expected: %d.\n",
43 mask, except_mask);
44 return 0;
47 #define TEST_FUNCTION do_test ()
48 #include "../test-skeleton.c"