1 // RUN: %clang_tsan -O1 %s -o %t && %env_tsan_opts=halt_on_error=1 %deflake %run %t | FileCheck %s
6 void *Thread(void *x
) {
7 barrier_wait(&barrier
);
13 barrier_init(&barrier
, 2);
14 fprintf(stderr
, "BEFORE\n");
16 pthread_create(&t
, 0, Thread
, 0);
18 barrier_wait(&barrier
);
20 fprintf(stderr
, "AFTER\n");
25 // CHECK: WARNING: ThreadSanitizer: data race