From 6c46dada59a56f8748f6d956ef5d318155195840 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 12 Mar 1996 10:01:41 +0000 Subject: Tue Mar 12 04:57:57 1996 Roland McGrath * setjmp/Makefile (tests): Add jmpbug. * setjmp/jmpbug.c: New file. --- setjmp/jmpbug.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 setjmp/jmpbug.c (limited to 'setjmp/jmpbug.c') diff --git a/setjmp/jmpbug.c b/setjmp/jmpbug.c new file mode 100644 index 0000000000..57a1de0978 --- /dev/null +++ b/setjmp/jmpbug.c @@ -0,0 +1,32 @@ +/* setjmp vs alloca test case. Exercised bug on sparc. */ + +#include +#include +#include + +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; +} -- cgit v1.2.3