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 | |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 4 | // bench.h needs pthread barriers which are not available on OS X |
| 5 | // UNSUPPORTED: darwin |
| 6 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 7 | #include "bench.h" |
| 8 | |
| 9 | int x; |
| 10 | |
| 11 | void thread(int tid) { |
| 12 | for (int i = 0; i < bench_niter; i++) |
| 13 | __atomic_fetch_add(&x, 1, __ATOMIC_ACQ_REL); |
| 14 | } |
| 15 | |
| 16 | void bench() { |
| 17 | start_thread_group(bench_nthread, thread); |
| 18 | } |
| 19 | |
| 20 | // CHECK: DONE |
| 21 | |