Index: lib/Fuzzer/test/fuzzer-oom-darwin.test =================================================================== --- /dev/null +++ lib/Fuzzer/test/fuzzer-oom-darwin.test @@ -0,0 +1,5 @@ +REQUIRES: darwin +RUN: not LLVMFuzzer-OutOfMemoryTest -rss_limit_mb=10 2>&1 | FileCheck %s +CHECK: ERROR: libFuzzer: out-of-memory (used: {{.*}}; limit: 10Mb) +CHECK: Test unit written to ./oom- +SUMMARY: libFuzzer: out-of-memory Index: lib/Fuzzer/test/fuzzer-oom-linux.test =================================================================== --- /dev/null +++ lib/Fuzzer/test/fuzzer-oom-linux.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 Index: lib/Fuzzer/test/fuzzer-oom.test =================================================================== --- lib/Fuzzer/test/fuzzer-oom.test +++ /dev/null @@ -1,5 +0,0 @@ -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 Index: lib/Fuzzer/test/lit.cfg =================================================================== --- lib/Fuzzer/test/lit.cfg +++ 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,16 @@ else: lit_config.note('lsan feature unavailable') +# Add host platform as a feature +hostPlatform = None +if sys.platform == 'darwin': + hostPlatform = 'darwin' +elif sys.platform.startswith('linux'): + # Note the value of ``sys.platform`` is not consistent + # between python 2 and 3, hence the use of ``.startswith()``. + hostPlatform = 'linux' +else: + lit_config.fatal('Platform "{}" is not supported.'.format(sys.platform)) +lit_config.note('Host platform is {}'.format(hostPlatform)) +config.available_features.add(hostPlatform) +