1 RUN: %cpp_compiler %S/OutOfMemoryTest.cpp -o %t-LLVMFuzzer-OutOfMemoryTest
2 RUN: %cpp_compiler %S/OutOfMemorySingleLargeMallocTest.cpp -o %t-LLVMFuzzer-OutOfMemorySingleLargeMallocTest
3 RUN: %cpp_compiler %S/AccumulateAllocationsTest.cpp -o %t-LLVMFuzzer-AccumulateAllocationsTest
5 RUN: not %t-LLVMFuzzer-OutOfMemoryTest -rss_limit_mb=300 2>&1 | FileCheck %s
7 CHECK: ERROR: libFuzzer: out-of-memory (used: {{.*}}; limit: 300Mb)
8 CHECK: Test unit written to ./oom-
9 SUMMARY: libFuzzer: out-of-memory
11 RUN: not %t-LLVMFuzzer-OutOfMemorySingleLargeMallocTest -rss_limit_mb=300 2>&1 | FileCheck %s --check-prefix=SINGLE_LARGE_MALLOC
13 We used to check for "out-of-memory (malloc(53{{.*}}))", but that would fail
14 sometimes, so now we accept any OOM message.
16 SINGLE_LARGE_MALLOC: libFuzzer: out-of-memory
17 SINGLE_LARGE_MALLOC: in LLVMFuzzerTestOneInput
19 # Check that -rss_limit_mb=0 means no limit.
20 RUN: %t-LLVMFuzzer-AccumulateAllocationsTest -runs=1000 -rss_limit_mb=0