]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/regression/pthread/unwind/thread_normal_exit.cpp
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / regression / pthread / unwind / thread_normal_exit.cpp
1 /* $FreeBSD$ */
2 /* test stack unwinding for a new thread */
3
4 #include <pthread.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7
8 #include "Test.cpp"
9
10 void *
11 thr_routine(void *arg)
12 {
13         Test test;
14
15         pthread_exit(NULL);
16         printf("Bug, thread shouldn't be here\n");
17 }
18
19 int
20 main()
21 {
22         pthread_t td;
23
24         pthread_create(&td, NULL, thr_routine, NULL);
25         pthread_join(td, NULL);
26         check_destruct();
27         return (0);
28 }