From 73d9dfb42c34d4a426d58f43121cbba4716eff6b Mon Sep 17 00:00:00 2001 From: drepper Date: Wed, 19 Mar 1997 05:34:13 +0000 Subject: [PATCH] Add new test. --- setjmp/tst-setjmp.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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 -- 2.11.0