annotate compiler-rt/test/tsan/bench_single_writer.cpp @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clangxx_tsan %s -o %t
anatofuz
parents:
diff changeset
2 // RUN: %run %t 2>&1 | FileCheck %s
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 // bench.h needs pthread barriers which are not available on OS X
anatofuz
parents:
diff changeset
5 // UNSUPPORTED: darwin
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 #include "bench.h"
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 int x;
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 void thread(int tid) {
anatofuz
parents:
diff changeset
12 if (tid == 0) {
anatofuz
parents:
diff changeset
13 for (int i = 0; i < bench_niter; i++)
anatofuz
parents:
diff changeset
14 __atomic_store_n(&x, 0, __ATOMIC_RELEASE);
anatofuz
parents:
diff changeset
15 } else {
anatofuz
parents:
diff changeset
16 for (int i = 0; i < bench_niter; i++)
anatofuz
parents:
diff changeset
17 __atomic_load_n(&x, __ATOMIC_ACQUIRE);
anatofuz
parents:
diff changeset
18 }
anatofuz
parents:
diff changeset
19 }
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 void bench() {
anatofuz
parents:
diff changeset
22 start_thread_group(bench_nthread, thread);
anatofuz
parents:
diff changeset
23 }
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 // CHECK: DONE
anatofuz
parents:
diff changeset
26