1 // RUN: %clangxx_tsan -O1 -fno-inline-functions %s -o %t && %deflake %run %t | FileCheck %s
5 std::unique_ptr
<long> global(new long(42));
7 void *thread(void *x
) {
9 barrier_wait(&barrier
);
14 barrier_init(&barrier
, 2);
16 pthread_create(&th
, nullptr, thread
, nullptr);
18 barrier_wait(&barrier
);
22 // CHECK: WARNING: ThreadSanitizer: data race
23 // CHECK: Write of size 8
24 // The exact spelling and number of std frames is hard to guess.
26 // CHECK: #{{[1-9]}} cxa_at_exit_callback_installed_at
27 // CHECK: #{{[2-9]}} __cxx_global_var_init