1 // RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
7 void *Thread(void *x
) {
9 barrier_wait(&barrier
);
14 barrier_init(&barrier
, 2);
15 mem
= (int*)malloc(100);
17 pthread_create(&t
, 0, Thread
, 0);
18 barrier_wait(&barrier
);
20 pthread_join(t
, NULL
);
24 // CHECK: WARNING: ThreadSanitizer: data race
25 // CHECK: Write of size 8 at {{.*}} by main thread{{.*}}:
27 // CHECK: #{{(1|2)}} main
28 // CHECK: Previous write of size 4 at {{.*}} by thread T1{{.*}}: