summaryrefslogtreecommitdiffstats
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
commit8cc4002df2a8a07aa14d01ac9f7c2402254f27a8 (patch)
treeac9ba609cc7085e0a38ec547b3a7192603d768b7
parent616b9f035c35318443787aaa01b7f3ebc4fd02b7 (diff)
downloadbcm5719-llvm-8cc4002df2a8a07aa14d01ac9f7c2402254f27a8.tar.gz
bcm5719-llvm-8cc4002df2a8a07aa14d01ac9f7c2402254f27a8.zip
[asan] make a test consume 2x less RAM (we observe flaky bot failures that seem like OOMs)
llvm-svn: 225478
-rw-r--r--compiler-rt/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc b/compiler-rt/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc
index 187139e1a58..a92796da710 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc
+++ b/compiler-rt/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
OpenPOWER on IntegriCloud