1 // RUN: %clang_lsan %s -o %t && %env_lsan_opts=log_threads=1 %run %t 2>&1 | FileCheck %s
5 // No pthread barriers on Darwin.
10 #include <sanitizer/lsan_interface.h>
15 pthread_barrier_t bar
;
17 void *threadfn(void *arg
) {
18 pthread_barrier_wait(&bar
);
23 int main(int argc
, char *argv
[]) {
25 pthread_barrier_init(&bar
, 0, 3);
27 pthread_create(&thread_id
, 0, threadfn
, 0);
28 pthread_create(&thread_id
, 0, threadfn
, 0);
30 pthread_barrier_wait(&bar
);
34 // CHECK: Thread T0/{{[0-9]+}} was created by T-1
35 // CHECK: Thread T1/{{[0-9]+}} was created by T0/
36 // CHECK: Thread T2/{{[0-9]+}} was created by T0/