From 0ca8ab340d37b7aae4186d61084ccad5737eb443 Mon Sep 17 00:00:00 2001 From: David Leonard Date: Thu, 2 Dec 1999 02:42:18 +0000 Subject: better tests --- lib/libc_r/TEST/test_setjmp.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'lib/libc_r') diff --git a/lib/libc_r/TEST/test_setjmp.c b/lib/libc_r/TEST/test_setjmp.c index 31610fd8387..8d78f4d5f63 100644 --- a/lib/libc_r/TEST/test_setjmp.c +++ b/lib/libc_r/TEST/test_setjmp.c @@ -3,16 +3,34 @@ int reached; -main() +void * +jump(arg) + void *arg; { jmp_buf foo; reached = 0; if (setjmp(foo)) { ASSERT(reached); - SUCCEED; + return NULL; } reached = 1; longjmp(foo, 1); PANIC("longjmp"); } + +int +main() +{ + pthread_t child; + void *res; + + printf("jumping in main thread\n"); + (void)jump(NULL); + + printf("jumping in child thread\n"); + CHECKr(pthread_create(&child, NULL, jump, NULL)); + CHECKr(pthread_join(child, &res)); + + SUCCEED; +} -- cgit v1.2.3