summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2015-01-08 23:37:09 +0000
committerKostya Serebryany <kcc@google.com>2015-01-08 23:37:09 +0000
commit9f18483ec25aa688e72d0eb148de8ccc5ea139e4 (patch)
treee5d0e4ffc0aeae5d6decf11d042a360867954f86
parent3337d4d9364304c52e44ef272e5b8f39f6a8c4fa (diff)
downloadcompiler-rt-9f18483ec25aa688e72d0eb148de8ccc5ea139e4.tar.gz
[asan] make a test consume 2x less RAM (we observe flaky bot failures that seem like OOMs)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@225478 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc b/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc
index 187139e1a..a92796da7 100644
--- a/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc
+++ b/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc
@@ -2,8 +2,8 @@
// RUN: %clangxx -O2 %s -o %t
//
// Run with limit should fail:
-// RUN: %tool_options=soft_rss_limit_mb=400:quarantine_size=1:allocator_may_return_null=1 %run %t 2>&1 | FileCheck %s -check-prefix=CHECK_MAY_RETURN_1
-// RUN: %tool_options=soft_rss_limit_mb=400:quarantine_size=1:allocator_may_return_null=0 not %run %t 2>&1 | FileCheck %s -check-prefix=CHECK_MAY_RETURN_0
+// RUN: %tool_options=soft_rss_limit_mb=220:quarantine_size=1:allocator_may_return_null=1 %run %t 2>&1 | FileCheck %s -check-prefix=CHECK_MAY_RETURN_1
+// RUN: %tool_options=soft_rss_limit_mb=220:quarantine_size=1:allocator_may_return_null=0 not %run %t 2>&1 | FileCheck %s -check-prefix=CHECK_MAY_RETURN_0
// FIXME: make it work for other sanitizers.
// XFAIL: lsan
@@ -14,8 +14,8 @@
#include <string.h>
#include <unistd.h>
-static const int kMaxNumAllocs = 1 << 10;
-static const int kAllocSize = 1 << 20; // Large enough to go vi mmap.
+static const int kMaxNumAllocs = 1 << 9;
+static const int kAllocSize = 1 << 20; // Large enough to go via mmap.
static char *allocs[kMaxNumAllocs];
@@ -25,7 +25,7 @@ int main() {
fprintf(stderr, "[%d] allocating %d times\n", i, num_allocs);
int zero_results = 0;
for (int j = 0; j < num_allocs; j++) {
- if ((j % (num_allocs / 4)) == 0) {
+ if ((j % (num_allocs / 8)) == 0) {
usleep(100000);
fprintf(stderr, " [%d]\n", j);
}
@@ -47,16 +47,16 @@ int main() {
}
}
+// CHECK_MAY_RETURN_1: allocating 128 times
+// CHECK_MAY_RETURN_1: Some of the malloc calls returned non-null: 128
// CHECK_MAY_RETURN_1: allocating 256 times
-// CHECK_MAY_RETURN_1: Some of the malloc calls returned non-null: 256
-// CHECK_MAY_RETURN_1: allocating 512 times
// CHECK_MAY_RETURN_1: Some of the malloc calls returned null:
// CHECK_MAY_RETURN_1: Some of the malloc calls returned non-null:
-// CHECK_MAY_RETURN_1: allocating 1024 times
+// CHECK_MAY_RETURN_1: allocating 512 times
// CHECK_MAY_RETURN_1: Some of the malloc calls returned null:
// CHECK_MAY_RETURN_1: Some of the malloc calls returned non-null:
+// CHECK_MAY_RETURN_0: allocating 128 times
+// CHECK_MAY_RETURN_0: Some of the malloc calls returned non-null: 128
// CHECK_MAY_RETURN_0: allocating 256 times
-// CHECK_MAY_RETURN_0: Some of the malloc calls returned non-null: 256
-// CHECK_MAY_RETURN_0: allocating 512 times
// CHECK_MAY_RETURN_0: allocator is terminating the process instead of returning