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