1 /* { dg-shouldfail "tsan" } */
2 /* { dg-additional-options "-ldl" } */
8 #include "tsan_barrier.h"
10 static pthread_barrier_t barrier;
14 sem_init(&sem_, 0, 0);
34 static A *obj = new B;
36 void *Thread1(void *x) {
39 barrier_wait(&barrier);
43 void *Thread2(void *x) {
44 barrier_wait(&barrier);
50 barrier_init(&barrier, 2);
52 pthread_create(&t[0], NULL, Thread1, NULL);
53 pthread_create(&t[1], NULL, Thread2, NULL);
54 pthread_join(t[0], NULL);
55 pthread_join(t[1], NULL);
58 /* { dg-output "WARNING: ThreadSanitizer: data race on vptr.*(\n|\r\n|\r)" } */