1 // RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
4 void *Thread(void *x
) {
5 barrier_wait(&barrier
);
10 barrier_init(&barrier
, 2);
12 pthread_create(&t
, 0, Thread
, 0);
13 barrier_wait(&barrier
);
14 sleep(1); // wait for the thread to finish and exit
18 // CHECK: WARNING: ThreadSanitizer: thread leak
19 // CHECK: SUMMARY: ThreadSanitizer: thread leak{{.*}}main