Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / tsan / bench_malloc.cpp
blobfb15ab25bec0a93ebe8f19602562c22a12c77241
1 // RUN: %clangxx_tsan %s -o %t
2 // RUN: %run %t 2>&1 | FileCheck %s
4 // bench.h needs pthread barriers which are not available on OS X
5 // UNSUPPORTED: darwin
7 #include "bench.h"
9 void thread(int tid) {
10 void **blocks = new void *[bench_mode];
11 for (int i = 0; i < bench_niter; i++) {
12 for (int j = 0; j < bench_mode; j++)
13 blocks[j] = malloc(8);
14 for (int j = 0; j < bench_mode; j++)
15 free(blocks[j]);
17 delete[] blocks;
20 void bench() { start_thread_group(bench_nthread, thread); }
22 // CHECK: DONE