1 // Test for cleanups in the main thread, too.
4 // { dg-require-effective-target c++11 }
5 // { dg-require-effective-target tls_runtime }
6 // { dg-require-effective-target pthread }
7 // { dg-require-alias }
8 // { dg-require-cxa-atexit "" }
9 // { dg-options -pthread }
27 void *thread_main(void *)
36 pthread_create (&thread, 0, thread_main, 0);
37 pthread_join(thread, 0);
38 pthread_create (&thread, 0, thread_main, 0);
39 pthread_join(thread, 0);
41 // The dtor for a in the main thread is run after main exits, so we
42 // return 1 now and override the return value with _exit above.