diff options
| author | George Karpenkov <ekarpenkov@apple.com> | 2017-08-04 17:19:45 +0000 |
|---|---|---|
| committer | George Karpenkov <ekarpenkov@apple.com> | 2017-08-04 17:19:45 +0000 |
| commit | 8ecdd7be154affd28bf91217913676b00db62cb7 (patch) | |
| tree | 399c219e64c4dac67e1975ddbc8f5246e50aaabe /llvm/lib/Fuzzer/test/fuzzer-oom.test | |
| parent | ff77cc750cf99b875915a37c1146c5f56de0edc8 (diff) | |
| download | bcm5719-llvm-8ecdd7be154affd28bf91217913676b00db62cb7.tar.gz bcm5719-llvm-8ecdd7be154affd28bf91217913676b00db62cb7.zip | |
Port libFuzzer tests to LIT. Do not require two-stage build for check-fuzzer.
This revision ports all libFuzzer tests apart from the unittest to LIT.
The advantages of doing so include:
- Tests being self-contained
- Much easier debugging of a single test
- No need for using a two-stage compilation
The unit-test is still compiled using CMake, but it does not need a
freshly built compiler.
NOTE: The previous two-stage bot configuration will NOT work, as in the
second stage build LLVM_USE_SANITIZER is set, which disables ASAN from
being built.
Thus bots will be reconfigured in the next few commits.
Differential Revision: https://reviews.llvm.org/D36295
llvm-svn: 310075
Diffstat (limited to 'llvm/lib/Fuzzer/test/fuzzer-oom.test')
| -rw-r--r-- | llvm/lib/Fuzzer/test/fuzzer-oom.test | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Fuzzer/test/fuzzer-oom.test b/llvm/lib/Fuzzer/test/fuzzer-oom.test index 0c788f99d7f..96c18480396 100644 --- a/llvm/lib/Fuzzer/test/fuzzer-oom.test +++ b/llvm/lib/Fuzzer/test/fuzzer-oom.test @@ -1,10 +1,14 @@ -RUN: not LLVMFuzzer-OutOfMemoryTest -rss_limit_mb=300 2>&1 | FileCheck %s +RUN: %cpp_compiler %S/OutOfMemoryTest.cpp -o %t-LLVMFuzzer-OutOfMemoryTest +RUN: %cpp_compiler %S/OutOfMemorySingleLargeMallocTest.cpp -o %t-LLVMFuzzer-OutOfMemorySingleLargeMallocTest +RUN: %cpp_compiler %S/AccumulateAllocationsTest.cpp -o %t-LLVMFuzzer-AccumulateAllocationsTest + +RUN: not %t-LLVMFuzzer-OutOfMemoryTest -rss_limit_mb=300 2>&1 | FileCheck %s CHECK: ERROR: libFuzzer: out-of-memory (used: {{.*}}; limit: 300Mb) CHECK: Test unit written to ./oom- SUMMARY: libFuzzer: out-of-memory -RUN: not LLVMFuzzer-OutOfMemorySingleLargeMallocTest -rss_limit_mb=300 2>&1 | FileCheck %s --check-prefix=SINGLE_LARGE_MALLOC +RUN: not %t-LLVMFuzzer-OutOfMemorySingleLargeMallocTest -rss_limit_mb=300 2>&1 | FileCheck %s --check-prefix=SINGLE_LARGE_MALLOC We used to check for "out-of-memory (malloc(53{{.*}}))", but that would fail sometimes, so now we accept any OOM message. @@ -13,4 +17,4 @@ SINGLE_LARGE_MALLOC: libFuzzer: out-of-memory SINGLE_LARGE_MALLOC: in LLVMFuzzerTestOneInput # Check that -rss_limit_mb=0 means no limit. -RUN: LLVMFuzzer-AccumulateAllocationsTest -runs=1000 -rss_limit_mb=0 +RUN: %t-LLVMFuzzer-AccumulateAllocationsTest -runs=1000 -rss_limit_mb=0 |

