diff options
author | Roland McGrath <roland@gnu.org> | 1996-03-12 10:01:41 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1996-03-12 10:01:41 +0000 |
commit | 6c46dada59a56f8748f6d956ef5d318155195840 (patch) | |
tree | e3811ee4b324730a87c0e77552ba8261ed117557 /setjmp/jmpbug.c | |
parent | 1177c8babf74c7335c5f3bf09c45961bebeed6c6 (diff) | |
download | glibc-6c46dada59a56f8748f6d956ef5d318155195840.zip glibc-6c46dada59a56f8748f6d956ef5d318155195840.tar.gz glibc-6c46dada59a56f8748f6d956ef5d318155195840.tar.bz2 |
Tue Mar 12 04:57:57 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>cvs/libc-960314cvs/libc-960313cvs/libc-960312
* setjmp/Makefile (tests): Add jmpbug.
* setjmp/jmpbug.c: New file.
Diffstat (limited to 'setjmp/jmpbug.c')
-rw-r--r-- | setjmp/jmpbug.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/setjmp/jmpbug.c b/setjmp/jmpbug.c new file mode 100644 index 0000000..57a1de0 --- /dev/null +++ b/setjmp/jmpbug.c @@ -0,0 +1,32 @@ +/* setjmp vs alloca test case. Exercised bug on sparc. */ + +#include <stdio.h> +#include <setjmp.h> +#include <alloca.h> + +void +sub5 (jmp_buf buf) +{ + longjmp (buf, 1); +} + +int +main (void) +{ + jmp_buf buf; + char *foo; + int arr[100]; + + arr[77] = 76; + if (setjmp (buf)) + { + printf ("made it ok; %d\n", arr[77]); + exit (0); + } + + foo = (char *) alloca (128); + sub5 (buf); + + /* NOTREACHED */ + return 1; +} |