]> git.proxmox.com Git - rustc.git/blame - src/compiler-rt/test/tsan/bench_acquire_only.cc
Imported Upstream version 1.11.0+dfsg1
[rustc.git] / src / compiler-rt / test / tsan / bench_acquire_only.cc
CommitLineData
1a4d82fc
JJ
1// RUN: %clangxx_tsan %s -o %t
2// RUN: %run %t 2>&1 | FileCheck %s
3
3157f602
XL
4// bench.h needs pthread barriers which are not available on OS X
5// UNSUPPORTED: darwin
6
1a4d82fc
JJ
7#include "bench.h"
8
9int x;
10
11void thread(int tid) {
12 for (int i = 0; i < bench_niter; i++)
13 __atomic_load_n(&x, __ATOMIC_ACQUIRE);
14}
15
16void bench() {
17 __atomic_store_n(&x, 0, __ATOMIC_RELEASE);
18 start_thread_group(bench_nthread, thread);
19}
20
21// CHECK: DONE
22