diff options
Diffstat (limited to 'lib/libc_r/TEST/test_setjmp.c')
-rw-r--r-- | lib/libc_r/TEST/test_setjmp.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/libc_r/TEST/test_setjmp.c b/lib/libc_r/TEST/test_setjmp.c index ea24ecd63bc..31610fd8387 100644 --- a/lib/libc_r/TEST/test_setjmp.c +++ b/lib/libc_r/TEST/test_setjmp.c @@ -1,13 +1,18 @@ #include <setjmp.h> +#include "test.h" + +int reached; main() { -jmp_buf foo; + jmp_buf foo; -if (setjmp(foo)) { - exit(0); -} -printf("Hi mom\n"); -longjmp(foo, 1); -printf("Should never reach here\n"); + reached = 0; + if (setjmp(foo)) { + ASSERT(reached); + SUCCEED; + } + reached = 1; + longjmp(foo, 1); + PANIC("longjmp"); } |