diff --git a/llvm/lib/Fuzzer/test/fuzzer-oom-with-profile.test b/llvm/lib/Fuzzer/test/fuzzer-oom-with-profile.test new file mode 100644 index 000000000000..391fd4bb0ff6 --- /dev/null +++ b/llvm/lib/Fuzzer/test/fuzzer-oom-with-profile.test @@ -0,0 +1,6 @@ +REQUIRES: linux +RUN: not LLVMFuzzer-OutOfMemoryTest -rss_limit_mb=10 2>&1 | FileCheck %s +CHECK: ERROR: libFuzzer: out-of-memory (used: {{.*}}; limit: 10Mb) +CHECK: Live Heap Allocations +CHECK: Test unit written to ./oom- +SUMMARY: libFuzzer: out-of-memory diff --git a/llvm/lib/Fuzzer/test/fuzzer-oom.test b/llvm/lib/Fuzzer/test/fuzzer-oom.test index 4eeaef4c057a..4cdff2142fda 100644 --- a/llvm/lib/Fuzzer/test/fuzzer-oom.test +++ b/llvm/lib/Fuzzer/test/fuzzer-oom.test @@ -1,5 +1,4 @@ RUN: not LLVMFuzzer-OutOfMemoryTest -rss_limit_mb=10 2>&1 | FileCheck %s CHECK: ERROR: libFuzzer: out-of-memory (used: {{.*}}; limit: 10Mb) -CHECK: Live Heap Allocations CHECK: Test unit written to ./oom- SUMMARY: libFuzzer: out-of-memory diff --git a/llvm/lib/Fuzzer/test/lit.cfg b/llvm/lib/Fuzzer/test/lit.cfg index e625fbe2286e..e262e3c25850 100644 --- a/llvm/lib/Fuzzer/test/lit.cfg +++ b/llvm/lib/Fuzzer/test/lit.cfg @@ -1,4 +1,5 @@ import lit.formats +import sys config.name = "LLVMFuzzer" config.test_format = lit.formats.ShTest(True) @@ -25,3 +26,10 @@ if config.has_lsan: else: lit_config.note('lsan feature unavailable') +if sys.platform.startswith('linux'): + # Note the value of ``sys.platform`` is not consistent + # between python 2 and 3, hence the use of ``.startswith()``. + lit_config.note('linux feature available') + config.available_features.add('linux') +else: + lit_config.note('linux feature unavailable')