From: drepper Date: Wed, 19 Mar 1997 05:34:13 +0000 (+0000) Subject: Add new test. X-Git-Tag: libc-ud-970318~22 X-Git-Url: http://git.csclub.uwaterloo.ca/?p=kopensolaris-gnu%2Fglibc.git;a=commitdiff_plain;h=73d9dfb42c34d4a426d58f43121cbba4716eff6b Add new test. --- diff --git a/setjmp/tst-setjmp.c b/setjmp/tst-setjmp.c index 53fee89864..6147ae9567 100644 --- a/setjmp/tst-setjmp.c +++ b/setjmp/tst-setjmp.c @@ -52,6 +52,29 @@ main (void) jump (value + 1); } + if (!lose && value == 10) + { + /* Do a second test, this time without `setjmp' being a macro. */ +#undef setjmp + value = setjmp (env); + if (value != last_value + 1) + { + fputs("Shouldn't have ", stdout); + lose = 1; + } + last_value = value; + switch (value) + { + case 0: + puts("Saved environment."); + jump (0); + default: + printf ("Jumped to %d.\n", value); + if (value < 10) + jump (value + 1); + } + } + if (lose || value != 10) puts ("Test FAILED!"); else