sparc: disable cancellable system, as it fails in strange ways right now
[uclibc-ng.git] / test / setjmp / sigjmpbug.c
blob5b1718185218dfde83a92ce2703ff509c9b8e673
1 /* sigsetjmp vs alloca test case. Exercised bug on sparc. */
3 #include <stdio.h>
4 #include <setjmp.h>
5 #include <alloca.h>
7 int ret;
8 int verbose;
10 __attribute__ ((__noreturn__))
11 static void
12 sub5 (jmp_buf buf)
14 siglongjmp (buf, 1);
17 static void
18 test (int x)
20 sigjmp_buf buf;
21 char *foo;
22 int arr[100];
24 ++ret;
26 arr[77] = x;
27 if (sigsetjmp (buf, 1))
29 --ret;
30 if (verbose)
31 printf ("made it ok; %d\n", arr[77]);
32 return;
35 foo = (char *) alloca (128);
36 sub5 (buf);
39 int
40 main (int argc, char *argv[])
42 int i;
44 verbose = (argc != 1);
45 ret = 0;
47 for (i = 123; i < 345; ++i)
48 test (i);
50 return ret;