Revert "[InstCombine] Support gep nuw in icmp folds" (#118698)
[llvm-project.git] / compiler-rt / lib / sanitizer_common / tests / malloc_stress_transfer_test.cpp
blobcf38798f328affe9c96607999982a7796b05820c
1 #include <thread>
3 const size_t kAllocSize = 16;
4 const size_t kInitialNumAllocs = 1 << 10;
5 const size_t kPeriodicNumAllocs = 1 << 10;
6 const size_t kNumIterations = 1 << 7;
7 const size_t kNumThreads = 16;
9 void Thread() {
10 char *InitialAllocations[kInitialNumAllocs];
11 char *PeriodicaAllocations[kPeriodicNumAllocs];
12 for (auto &p : InitialAllocations) p = new char[kAllocSize];
13 for (size_t i = 0; i < kNumIterations; i++) {
14 for (size_t j = 0; j < kPeriodicNumAllocs; j++) {
15 for (auto &p : PeriodicaAllocations) {
16 p = new char[kAllocSize];
17 *p = 0;
19 for (auto p : PeriodicaAllocations) delete [] p;
22 for (auto p : InitialAllocations) delete [] p;
25 int main() {
26 std::thread *Threads[kNumThreads];
27 for (auto &T : Threads) T = new std::thread(&Thread);
28 for (auto T : Threads) {
29 T->join();
30 delete T;