summaryrefslogtreecommitdiffstats
path: root/tools/regression/pthread/unwind/thread_normal_exit.cpp
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2010-09-25 04:26:40 +0000
committerdavidxu <davidxu@FreeBSD.org>2010-09-25 04:26:40 +0000
commitb9b7f896c0989ace786c4764b1af88925c7291ec (patch)
tree2bcadd6fe6334c8cc80e05117061eeaa08e57ff4 /tools/regression/pthread/unwind/thread_normal_exit.cpp
parent2aedc66f1220dcc147eceb6cfe800aea0d722adf (diff)
downloadFreeBSD-src-b9b7f896c0989ace786c4764b1af88925c7291ec.zip
FreeBSD-src-b9b7f896c0989ace786c4764b1af88925c7291ec.tar.gz
Add test cases for stack unwinding.
Diffstat (limited to 'tools/regression/pthread/unwind/thread_normal_exit.cpp')
-rw-r--r--tools/regression/pthread/unwind/thread_normal_exit.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/regression/pthread/unwind/thread_normal_exit.cpp b/tools/regression/pthread/unwind/thread_normal_exit.cpp
new file mode 100644
index 0000000..faf900e
--- /dev/null
+++ b/tools/regression/pthread/unwind/thread_normal_exit.cpp
@@ -0,0 +1,28 @@
+/* $FreeBSD$ */
+/* test stack unwinding for a new thread */
+
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "Test.cpp"
+
+void *
+thr_routine(void *arg)
+{
+ Test test;
+
+ pthread_exit(NULL);
+ printf("Bug, thread shouldn't be here\n");
+}
+
+int
+main()
+{
+ pthread_t td;
+
+ pthread_create(&td, NULL, thr_routine, NULL);
+ pthread_join(td, NULL);
+ check_destruct();
+ return (0);
+}
OpenPOWER on IntegriCloud