summaryrefslogtreecommitdiff
path: root/lib/libc_r
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>1999-12-02 02:42:18 +0000
committerDavid Leonard <d@cvs.openbsd.org>1999-12-02 02:42:18 +0000
commit0ca8ab340d37b7aae4186d61084ccad5737eb443 (patch)
tree64d037a6a71f522f6c6458bfaad5be11e6f54e9d /lib/libc_r
parent02887bbf2fba29245dd1e86008c36360881891f2 (diff)
better tests
Diffstat (limited to 'lib/libc_r')
-rw-r--r--lib/libc_r/TEST/test_setjmp.c22
1 files changed, 20 insertions, 2 deletions
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;
+}