2017-08-22 07:25:50 +08:00
|
|
|
RUN: %cpp_compiler %S/OutOfMemoryTest.cpp -o %t-OutOfMemoryTest
|
|
|
|
RUN: %cpp_compiler %S/OutOfMemorySingleLargeMallocTest.cpp -o %t-OutOfMemorySingleLargeMallocTest
|
|
|
|
RUN: %cpp_compiler %S/AccumulateAllocationsTest.cpp -o %t-AccumulateAllocationsTest
|
|
|
|
|
2018-05-12 05:29:51 +08:00
|
|
|
RUN: not %run %t-OutOfMemoryTest -rss_limit_mb=300 2>&1 | FileCheck %s
|
2017-08-22 07:25:50 +08:00
|
|
|
|
|
|
|
CHECK: ERROR: libFuzzer: out-of-memory (used: {{.*}}; limit: 300Mb)
|
|
|
|
CHECK: Test unit written to ./oom-
|
|
|
|
SUMMARY: libFuzzer: out-of-memory
|
|
|
|
|
2018-05-12 05:29:51 +08:00
|
|
|
RUN: not %run %t-OutOfMemorySingleLargeMallocTest -rss_limit_mb=300 2>&1 | FileCheck %s --check-prefix=SINGLE_LARGE_MALLOC
|
|
|
|
RUN: not %run %t-OutOfMemorySingleLargeMallocTest -malloc_limit_mb=300 2>&1 | FileCheck %s --check-prefix=SINGLE_LARGE_MALLOC
|
|
|
|
RUN: not %run %t-OutOfMemorySingleLargeMallocTest -rss_limit_mb=1000 -malloc_limit_mb=300 2>&1 | FileCheck %s --check-prefix=SINGLE_LARGE_MALLOC
|
2017-08-22 07:25:50 +08:00
|
|
|
|
|
|
|
We used to check for "out-of-memory (malloc(53{{.*}}))", but that would fail
|
|
|
|
sometimes, so now we accept any OOM message.
|
|
|
|
|
|
|
|
SINGLE_LARGE_MALLOC: libFuzzer: out-of-memory
|
|
|
|
SINGLE_LARGE_MALLOC: in LLVMFuzzerTestOneInput
|
|
|
|
|
|
|
|
# Check that -rss_limit_mb=0 means no limit.
|
2018-05-12 05:29:51 +08:00
|
|
|
RUN: %run %t-AccumulateAllocationsTest -runs=1000 -rss_limit_mb=0
|