Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 1 | // RUN: %clangxx_tsan %s -o %t |
2 | // RUN: %run %t 2>&1 | FileCheck %s | ||||
3 | |||||
4 | #include "bench.h" | ||||
5 | |||||
6 | int x; | ||||
7 | |||||
8 | void thread(int tid) { | ||||
9 | for (int i = 0; i < bench_niter; i++) | ||||
10 | __atomic_load_n(&x, __ATOMIC_ACQUIRE); | ||||
11 | } | ||||
12 | |||||
13 | void bench() { | ||||
14 | __atomic_store_n(&x, 0, __ATOMIC_RELEASE); | ||||
15 | start_thread_group(bench_nthread, thread); | ||||
16 | } | ||||
17 | |||||
18 | // CHECK: DONE | ||||
19 |