brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · f7bccbf Raw
29 lines · cpp
1// Test quarantine_size_mb (and the deprecated quarantine_size)2// RUN: %clangxx_asan  %s -o %t3// RUN: %env_asan_opts=quarantine_size=10485760:verbosity=1:hard_rss_limit_mb=50 %run %t  2>&1 | FileCheck %s  --check-prefix=Q104// RUN: %env_asan_opts=quarantine_size_mb=10:verbosity=1:hard_rss_limit_mb=50    %run %t  2>&1 | FileCheck %s  --check-prefix=Q105// RUN: %env_asan_opts=quarantine_size_mb=10:quarantine_size=20:verbosity=1  not %run %t  2>&1 | FileCheck %s  --check-prefix=BOTH6// RUN: %env_asan_opts=quarantine_size_mb=1000:hard_rss_limit_mb=50 not  %run %t          2>&1 | FileCheck %s  --check-prefix=RSS_LIMIT7// RUN: %env_asan_opts=hard_rss_limit_mb=20                         not  %run %t          2>&1 | FileCheck %s  --check-prefix=RSS_LIMIT8 9// https://github.com/google/sanitizers/issues/98110// UNSUPPORTED: android-2611 12#include <string.h>13char *g;14 15static const int kNumAllocs = 1 << 11;16static const int kAllocSize = 1 << 20;17 18int main() {19  for (int i = 0; i < kNumAllocs; i++) {20    g = new char[kAllocSize];21    memset(g, -1, kAllocSize);22    delete [] (g);23  }24}25 26// Q10: quarantine_size_mb=10M27// BOTH: please use either 'quarantine_size' (deprecated) or quarantine_size_mb, but not both28// RSS_LIMIT: AddressSanitizer: hard rss limit exhausted29