aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.7/libmudflap/testsuite/libmudflap.cth/pass59-frag.c
blob: 49013067705af3162f004b6f8cf1e8038d2d07f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <stdio.h>
#include <pthread.h>

/* PR 28578 */

void* test_thread(void* arg)
{
  printf("Hello from thread!\n");
  pthread_exit(NULL);
  return 0;
}

int main()
{
  pthread_t thread;
  void *arg = NULL;
  pthread_create(&thread, NULL, test_thread, arg);
  pthread_join(thread, NULL);
  pthread_exit(NULL);
  return 0;
}

/* { dg-output "Hello from thread!\n" } */

#if 0

/* Even this test case replicates the problem.  However, when built in
   static mode, it blows up during __mf_init (?!?!?!) with a
   pthread_mutex_lock deadlock error. */

#include <stdio.h>
#include <pthread.h>

int main ()
{
      pthread_exit(NULL);
      return 0;
}
#endif