OSDN Git Service

96c184803967fc5194a613ce42880c8688105e1f
[android-x86/external-llvm.git] / lib / Fuzzer / test / fuzzer-oom.test
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
4
5 RUN: not %t-LLVMFuzzer-OutOfMemoryTest -rss_limit_mb=300 2>&1 | FileCheck %s
6
7 CHECK: ERROR: libFuzzer: out-of-memory (used: {{.*}}; limit: 300Mb)
8 CHECK: Test unit written to ./oom-
9 SUMMARY: libFuzzer: out-of-memory
10
11 RUN: not %t-LLVMFuzzer-OutOfMemorySingleLargeMallocTest -rss_limit_mb=300 2>&1 | FileCheck %s --check-prefix=SINGLE_LARGE_MALLOC
12
13 We used to check for "out-of-memory (malloc(53{{.*}}))", but that would fail
14 sometimes, so now we accept any OOM message.
15
16 SINGLE_LARGE_MALLOC: libFuzzer: out-of-memory
17 SINGLE_LARGE_MALLOC: in LLVMFuzzerTestOneInput
18
19 # Check that -rss_limit_mb=0 means no limit.
20 RUN: %t-LLVMFuzzer-AccumulateAllocationsTest -runs=1000 -rss_limit_mb=0