llvm-project
20 строк · 380.0 Байт
1// RUN: %clangxx_tsan %s -o %t
2// RUN: %run %t 2>&1 | FileCheck %s
3
4// bench.h needs pthread barriers which are not available on OS X
5// UNSUPPORTED: darwin
6
7#include "bench.h"8
9int x;10
11void thread(int tid) {12for (int i = 0; i < bench_niter; i++)13__atomic_fetch_add(&x, 1, __ATOMIC_ACQ_REL);14}
15
16void bench() {17start_thread_group(bench_nthread, thread);18}
19
20// CHECK: DONE
21
22