OSDN Git Service

2010-04-13 Martin Jambor <mjambor@suse.cz>
[pf3gnuchains/gcc-fork.git] / libmudflap / testsuite / libmudflap.cth / pass59-frag.c
1 #include <stdio.h>
2 #include <pthread.h>
3
4 /* PR 28578 */
5
6 void* test_thread(void* arg)
7 {
8   printf("Hello from thread!\n");
9   pthread_exit(NULL);
10   return 0;
11 }
12
13 int main()
14 {
15   pthread_t thread;
16   void *arg = NULL;
17   pthread_create(&thread, NULL, test_thread, arg);
18   pthread_join(thread, NULL);
19   pthread_exit(NULL);
20   return 0;
21 }
22
23 /* { dg-output "Hello from thread!\n" } */
24
25 #if 0
26
27 /* Even this test case replicates the problem.  However, when built in
28    static mode, it blows up during __mf_init (?!?!?!) with a
29    pthread_mutex_lock deadlock error. */
30
31 #include <stdio.h>
32 #include <pthread.h>
33
34 int main ()
35 {
36       pthread_exit(NULL);
37       return 0;
38 }
39 #endif