Index: compiler-rt/lib/fuzzer/tests/FuzzerTestUtil.h =================================================================== --- compiler-rt/lib/fuzzer/tests/FuzzerTestUtil.h +++ compiler-rt/lib/fuzzer/tests/FuzzerTestUtil.h @@ -42,6 +42,7 @@ char *Out, size_t OutLen) {}; EF->FuzzerRemotePrintStackTrace = [](unsigned long PID) {}; EF->FuzzerRemotePrintMemoryProfile = [](unsigned long PID) {}; + EF->FuzzerRemoteDetectLeaksAtExit = [](unsigned long PID) {}; } void TearDown() override { EF = nullptr; } Index: compiler-rt/test/fuzzer/BogusInitializeTest.cpp =================================================================== --- compiler-rt/test/fuzzer/BogusInitializeTest.cpp +++ compiler-rt/test/fuzzer/BogusInitializeTest.cpp @@ -8,9 +8,17 @@ extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) { ***argv = 'X'; +#ifdef FUZZER_IPC_PROXY + return fuzzer::ipc::ConfigureRemoteProcess(argc, argv); +#else return 0; +#endif // FUZZER_IPC_PROXY } extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { +#ifdef FUZZER_IPC_REMOTE + return fuzzer::ipc::ProxyAdapter::TestOneInput(Data, Size); +#else return 0; +#endif // FUZZER_IPC_REMOTE } Index: compiler-rt/test/fuzzer/CMakeLists.txt =================================================================== --- compiler-rt/test/fuzzer/CMakeLists.txt +++ compiler-rt/test/fuzzer/CMakeLists.txt @@ -17,19 +17,16 @@ darwin_filter_host_archs(FUZZER_SUPPORTED_ARCH FUZZER_TEST_ARCH) endif() +add_custom_target(check-fuzzer) + if(COMPILER_RT_INCLUDE_TESTS) + # libFuzzer unit tests. list(APPEND LIBFUZZER_TEST_DEPS FuzzerUnitTests) list(APPEND LIBFUZZER_TEST_DEPS FuzzedDataProviderUnitTests) list(APPEND LIBFUZZER_TEST_DEPS FuzzerRemoteUnitTests) list(APPEND LIBFUZZER_TEST_DEPS FuzzerIPCUnitTests) list(APPEND LIBFUZZER_TEST_DEPS FuzzerIPCProxyUnitTests) list(APPEND LIBFUZZER_TEST_DEPS FuzzerIPCRemoteUnitTests) -endif() - -add_custom_target(check-fuzzer) - -if(COMPILER_RT_INCLUDE_TESTS) - # libFuzzer unit tests. configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.py.in ${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg.py) @@ -40,16 +37,16 @@ add_dependencies(check-fuzzer check-fuzzer-unit) endif() -macro(test_fuzzer stdlib) - cmake_parse_arguments(TEST "" "" "DEPS" ${ARGN}) - string(REPLACE "+" "x" stdlib_name ${stdlib}) - string(REPLACE "-" ";" stdlib_list ${stdlib_name}) - set(STDLIB_CAPITALIZED "") - foreach(part IN LISTS stdlib_list) +macro(test_fuzzer config) + cmake_parse_arguments(TEST "" "REMOTE" "DEPS" ${ARGN}) + string(REPLACE "+" "x" config_name ${config}) + string(REPLACE "-" ";" config_list ${config_name}) + set(CONFIG_CAPITALIZED "") + foreach(part IN LISTS config_list) string(SUBSTRING ${part} 0 1 first_letter) string(TOUPPER ${first_letter} first_letter) string(REGEX REPLACE "^.(.*)" "${first_letter}\\1" part "${part}") - set(STDLIB_CAPITALIZED "${STDLIB_CAPITALIZED}${part}") + set(CONFIG_CAPITALIZED "${CONFIG_CAPITALIZED}${part}") endforeach() foreach(arch ${FUZZER_TEST_ARCH}) set(LIBFUZZER_TEST_COMPILER ${COMPILER_RT_TEST_COMPILER}) @@ -62,24 +59,28 @@ set(LIBFUZZER_TEST_STDLIB ${stdlib}) string(TOUPPER ${arch} ARCH_UPPER_CASE) - set(CONFIG_NAME ${ARCH_UPPER_CASE}${STDLIB_CAPITALIZED}${OS_NAME}Config) + set(CONFIG_NAME ${ARCH_UPPER_CASE}${CONFIG_CAPITALIZED}${OS_NAME}Config) # LIT-based libFuzzer tests. + if(NOT DEFINED TEST_REMOTE) + set(TEST_REMOTE 0) + endif() + set(LIBFUZZER_TEST_USE_REMOTE ${TEST_REMOTE}) + configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py - ) + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py) - add_lit_testsuite(check-fuzzer-${stdlib_name}-${arch} + add_lit_testsuite(check-fuzzer-${config_name}-${arch} "Running libFuzzer ${stdlib} tests for arch ${arch}" ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/ DEPENDS ${LIBFUZZER_TEST_DEPS}) if(TEST_DEPS) - add_dependencies(check-fuzzer-${stdlib_name}-${arch} ${TEST_DEPS}) + add_dependencies(check-fuzzer-${config_name}-${arch} ${TEST_DEPS}) endif() - set_target_properties(check-fuzzer-${stdlib_name}-${arch} + set_target_properties(check-fuzzer-${config_name}-${arch} PROPERTIES FOLDER "Compiler-RT Tests") - add_dependencies(check-fuzzer check-fuzzer-${stdlib_name}-${arch}) + add_dependencies(check-fuzzer check-fuzzer-${config_name}-${arch}) endforeach() endmacro() @@ -91,6 +92,32 @@ if(TARGET cxx_static) test_fuzzer("static-libc++" DEPS cxx_static) endif() + + test_fuzzer("remote" REMOTE 1) + foreach(arch ${FUZZER_TEST_ARCH}) + # Most remote fuzzer tests use the default fuzzer proxy. Build it once here + # rather than in every test that uses it. + set(output_bin ${CMAKE_CURRENT_BINARY_DIR}/FuzzerProxy-${arch}) + add_custom_command( + OUTPUT "${output_bin}" + COMMAND ${COMPILER_RT_TEST_COMPILER} + --driver-mode=g++ + -fsanitize-coverage=inline-8bit-counters,pc-table + "${CMAKE_CURRENT_SOURCE_DIR}/IPCProxy.cpp" + "${COMPILER_RT_BINARY_DIR}/lib/fuzzer/ipc/libRTFuzzerIPCProxy-${arch}.a" + -lpthread + "${CMAKE_CURRENT_SOURCE_DIR}/IPCProxyDefault.cpp" + -o "${output_bin}" + DEPENDS IPCProxy.cpp + RTFuzzerIPCProxy-${arch} + IPCProxyDefault.cpp + clang) + add_custom_target(DefaultFuzzerProxy-${arch} DEPENDS "${output_bin}") + add_dependencies(check-fuzzer-remote-${arch} + DefaultFuzzerProxy-${arch} + RTFuzzerIPCProxy-${arch} + RTFuzzerIPCRemote-${arch}) + endforeach(arch) endif() if (APPLE) @@ -121,8 +148,7 @@ set(LIBFUZZER_TEST_MIN_DEPLOYMENT_TARGET_FLAG "${DARWIN_${platform}_MIN_VER_FLAG}") configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py - ) + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py) add_lit_testsuite(check-fuzzer-${platform}-${arch} "libFuzzer ${platform} ${arch} tests" EXCLUDE_FROM_CHECK_ALL ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/ Index: compiler-rt/test/fuzzer/CompressedTest.cpp =================================================================== --- compiler-rt/test/fuzzer/CompressedTest.cpp +++ compiler-rt/test/fuzzer/CompressedTest.cpp @@ -10,6 +10,8 @@ #include #include +#ifndef FUZZER_IPC_PROXY + // The fuzz target. // Uncompress the data, crash on input starting with "FU". // Good luck finding this w/o a custom mutator. :) @@ -24,6 +26,9 @@ return 0; } +#endif // !FUZZER_IPC_PROXY + +#ifndef FUZZER_IPC_REMOTE #ifdef CUSTOM_MUTATOR // Forward-declare the libFuzzer's mutator callback. @@ -59,3 +64,4 @@ } #endif // CUSTOM_MUTATOR +#endif // !FUZZER_IPC_REMOTE Index: compiler-rt/test/fuzzer/CrossOverTest.cpp =================================================================== --- compiler-rt/test/fuzzer/CrossOverTest.cpp +++ compiler-rt/test/fuzzer/CrossOverTest.cpp @@ -45,6 +45,8 @@ // fprintf(stderr, "ExpectedHash: %x\n", ExpectedHash); if (Size == 10 && ExpectedHash == simple_hash(Data, Size)) *NullPtr = 0; + if (Size == 0) + return 0; if (*Data == 'A') Sink++; if (*Data == 'Z') Index: compiler-rt/test/fuzzer/CustomCrossOverAndMutateTest.cpp =================================================================== --- compiler-rt/test/fuzzer/CustomCrossOverAndMutateTest.cpp +++ compiler-rt/test/fuzzer/CustomCrossOverAndMutateTest.cpp @@ -14,6 +14,7 @@ #include "FuzzerInterface.h" +#ifndef FUZZER_IPC_PROXY static volatile int sink; extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { @@ -22,7 +23,9 @@ sink++; return 0; } +#endif // !FUZZER_IPC_PROXY +#ifndef FUZZER_IPC_REMOTE extern "C" size_t LLVMFuzzerCustomCrossOver(const uint8_t *Data1, size_t Size1, const uint8_t *Data2, size_t Size2, uint8_t *Out, size_t MaxOutSize, @@ -33,3 +36,4 @@ memcpy(Out, Data1, Size); return Size; } +#endif // !FUZZER_IPC_REMOTE Index: compiler-rt/test/fuzzer/CustomCrossOverTest.cpp =================================================================== --- compiler-rt/test/fuzzer/CustomCrossOverTest.cpp +++ compiler-rt/test/fuzzer/CustomCrossOverTest.cpp @@ -13,7 +13,7 @@ #include #include -static const char *Separator = "-########-"; +#ifndef FUZZER_IPC_PROXY static const char *Target = "A-########-B"; static volatile int sink; @@ -36,6 +36,10 @@ } return 0; } +#endif // !FUZZER_IPC_PROXY + +#ifndef FUZZER_IPC_REMOTE +static const char *Separator = "-########-"; extern "C" size_t LLVMFuzzerCustomCrossOver(const uint8_t *Data1, size_t Size1, const uint8_t *Data2, size_t Size2, @@ -58,3 +62,4 @@ return Size; } +#endif // !FUZZER_IPC_REMOTE Index: compiler-rt/test/fuzzer/CustomMutatorTest.cpp =================================================================== --- compiler-rt/test/fuzzer/CustomMutatorTest.cpp +++ compiler-rt/test/fuzzer/CustomMutatorTest.cpp @@ -12,6 +12,7 @@ #include "FuzzerInterface.h" +#ifndef FUZZER_IPC_PROXY static volatile int Sink; extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { @@ -28,7 +29,9 @@ } return 0; } +#endif // !FUZZER_IPC_PROXY +#ifndef FUZZER_IPC_REMOTE extern "C" size_t LLVMFuzzerCustomMutator(uint8_t *Data, size_t Size, size_t MaxSize, unsigned int Seed) { static bool Printed; @@ -38,3 +41,4 @@ } return LLVMFuzzerMutate(Data, Size, MaxSize); } +#endif // !FUZZER_IPC_REMOTE Index: compiler-rt/test/fuzzer/CustomMutatorWithLongSequencesTest.cpp =================================================================== --- compiler-rt/test/fuzzer/CustomMutatorWithLongSequencesTest.cpp +++ compiler-rt/test/fuzzer/CustomMutatorWithLongSequencesTest.cpp @@ -12,6 +12,7 @@ #include "FuzzerInterface.h" +#ifndef FUZZER_IPC_PROXY static volatile int Sink; extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { @@ -29,7 +30,9 @@ } return 0; } +#endif // !FUZZER_IPC_PROXY +#ifndef FUZZER_IPC_REMOTE extern "C" size_t LLVMFuzzerCustomMutator(uint8_t *Data, size_t Size, size_t MaxSize, unsigned int Seed) { // Run this 25 times to generate a large mutation sequence. @@ -38,3 +41,4 @@ } return LLVMFuzzerMutate(Data, Size, MaxSize); } +#endif // !FUZZER_IPC_REMOTE Index: compiler-rt/test/fuzzer/IPCProxy.h =================================================================== --- /dev/null +++ compiler-rt/test/fuzzer/IPCProxy.h @@ -0,0 +1,74 @@ +//===- IPCTestProxyLinux.h ------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// Proxies test inputs to fuzzer tests implemented as remote fuzzers. +// +// See also IPCTestRemoteLinux.cpp. +//===----------------------------------------------------------------------===// + +#ifndef COMPILER_RT_TEST_FUZZER_IPC_PROXY_H +#define COMPILER_RT_TEST_FUZZER_IPC_PROXY_H + +#ifdef __linux__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define RETRY_ON_EINTR(R, X) \ + do { \ + R = (X); \ + } while (R == -1 && errno == EINTR) + +namespace fuzzer { +namespace ipc { + +// Modify command line arguments. this should be called by +// LLVMFuzzerInitialize in the FuzzerProxy process. +int ConfigureRemoteProcess(int *pArgc, char ***pArgv, bool IgnoreRemoteExits = false); + +// The ProxyAdapter can be used to convert conventional fuzz targets into remote +// fuzzers, e.g. for integration testing. +class ProxyAdapter final { +public: + // These indicate pipes to/from the child process started as a remote fuzzer. + static constexpr int kTestInputReader = STDERR_FILENO + 1; + static constexpr int kResultWriter = kTestInputReader + 1; + + // On the first invocation of this method, the process configured by + // ConfigureRemoteProcess will be started, with the pipes indicated by the + // kTestInputReader and kResultWriter file descriptors attached. + static int TestOneInput(const uint8_t *Data, size_t Size); + +private: + ProxyAdapter(); + ~ProxyAdapter(); + + int TestOneInputImpl(const uint8_t *Data, size_t Size); + + int PID = -1; + int TestInputWriter = -1; + ; + int ResultReader = -1; +}; + +} // namespace ipc +} // namespace fuzzer + +#endif // __linux__ + +#endif // COMPILER_RT_TEST_FUZZER_IPC_PROXY_H Index: compiler-rt/test/fuzzer/IPCProxy.cpp =================================================================== --- /dev/null +++ compiler-rt/test/fuzzer/IPCProxy.cpp @@ -0,0 +1,173 @@ +//===- IPCTestProxyLinux.cpp ----------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// Proxies test inputs to fuzzer tests implemented as remote fuzzers. +// +// See also IPCTestRemoteLinux.cpp. +//===----------------------------------------------------------------------===// + +#ifdef __linux__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "IPCProxy.h" + +namespace fuzzer { +namespace ipc { +namespace { + +const char *gRemoteTest = nullptr; +const char *kRemoteFlag = "-remote=1"; +const char *kIgnoreRemoteExitsFlag = "-ignore-remote-exits=1"; +const char *kRemoteTestEnvVar = "FUZZER_REMOTE_TEST"; + +bool StartsWith(const char *S, const char *T) { + if (!S || !T) + return false; + auto SLen = strlen(S); + auto TLen = strlen(T); + return SLen >= TLen && strncmp(S, T, TLen) == 0; +} + +} // namespace + +// Public methods + +int ConfigureRemoteProcess(int *pArgc, char ***pArgv, bool IgnoreRemoteExits) { + char **Argv = *pArgv; + int Argc = *pArgc; + static std::vector Args; + Args.push_back(Argv[0]); + Args.push_back(kRemoteFlag); + if (IgnoreRemoteExits) + Args.push_back(kIgnoreRemoteExitsFlag); + for (int i = 1; i < Argc; ++i) { + const char *Arg = Argv[i]; + if (Arg[0] == '-' || gRemoteTest) + Args.push_back(Arg); + else + gRemoteTest = Arg; + } + if (!gRemoteTest) + gRemoteTest = getenv(kRemoteTestEnvVar); + if (!gRemoteTest) { + fprintf(stderr, "ERROR: Missing remote executable name.\n"); + exit(1); + } + if (setenv(kRemoteTestEnvVar, gRemoteTest, /* override */ 1) == -1) { + perror("setenv"); + exit(1); + } + *pArgc = Args.size(); + *pArgv = const_cast(&Args[0]); + return 0; +} + +int ProxyAdapter::TestOneInput(const uint8_t *Data, size_t Size) { + static ProxyAdapter Singleton; + return Singleton.TestOneInputImpl(Data, Size); +} + +// Private methods + +ProxyAdapter::ProxyAdapter() { + int TestInputPipe[2]; + int ResultPipe[2]; + if (pipe(TestInputPipe) == -1 || pipe(ResultPipe) == -1) { + perror("pipe"); + exit(1); + } + if (sigignore(SIGCHLD) == -1) { + perror("sigignore"); + exit(1); + } + auto PID = fork(); + if (PID == -1) { + perror("fork"); + } + // Child + if (PID == 0) { + if (dup2(TestInputPipe[0], kTestInputReader) == -1 || dup2(ResultPipe[1], kResultWriter) == -1) { + perror("dup2"); + exit(1); + } + close(TestInputPipe[0]); + close(TestInputPipe[1]); + close(ResultPipe[0]); + close(ResultPipe[1]); + execl(gRemoteTest, gRemoteTest, (char *)nullptr); + perror("execl"); + exit(1); + } + // Parent + close(TestInputPipe[0]); + TestInputWriter = TestInputPipe[1]; + ResultReader = ResultPipe[0]; + close(ResultPipe[1]); +} + +ProxyAdapter::~ProxyAdapter() { + close(TestInputWriter); + close(ResultReader); + if (PID > 0) + kill(PID, SIGKILL); +} + +int ProxyAdapter::TestOneInputImpl(const uint8_t *Data, size_t Size) { + int N = 0; + RETRY_ON_EINTR(N, write(TestInputWriter, &Size, sizeof(Size))); + if (N < 0) { + perror("write"); + exit(1); + } + if (N != sizeof(Size)) { + fprintf(stderr, "==%d== ERROR: incomplete write of test input size: %d of %zu bytes.\n", getpid(), N, sizeof(Size)); + exit(1); + } + + if (Size) { + RETRY_ON_EINTR(N, write(TestInputWriter, Data, Size)); + if (N < 0) { + perror("write"); + exit(1); + } + if (size_t(N) != Size) { + fprintf(stderr, "==%d== ERROR: incomplete write of test input data: %d of %zu bytes.\n", getpid(), N, Size); + exit(1); + } + } + int Result; + RETRY_ON_EINTR(N, read(ResultReader, &Result, sizeof(Result))); + if (N < 0) { + perror("read"); + exit(1); + } + if (N == 0) + exit(0); + if (N != sizeof(Result)) { + fprintf(stderr, "==%d== ERROR: incomplete read of test result: %d of %zu bytes.\n", getpid(), N, sizeof(Result)); + exit(1); + } + return Result; +} + +} // namespace ipc +} // namespace fuzzer + +#endif // __linux__ Index: compiler-rt/test/fuzzer/IPCProxyDefault.cpp =================================================================== --- /dev/null +++ compiler-rt/test/fuzzer/IPCProxyDefault.cpp @@ -0,0 +1,25 @@ +//===- IPCTestProxyLinuxDefault.cpp ---------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// Default IPC test proxy implementation. +//===----------------------------------------------------------------------===// + +#include "IPCProxy.h" +#include +#include + +extern "C" { + +int LLVMFuzzerInitialize(int *pArgc, char ***pArgv) { + return fuzzer::ipc::ConfigureRemoteProcess(pArgc, pArgv); +} + +int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { + return fuzzer::ipc::ProxyAdapter::TestOneInput(Data, Size); +} + +} // extern "C" Index: compiler-rt/test/fuzzer/IPCRemote.cpp =================================================================== --- /dev/null +++ compiler-rt/test/fuzzer/IPCRemote.cpp @@ -0,0 +1,97 @@ +//===- IPCTestRemoteLinux.cpp ---------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// Transforms fuzzer test implementations into remote fuzzers. +// +// See also IPCTestProxyLinux.cpp. +//===----------------------------------------------------------------------===// + +#ifdef __linux__ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "IPCProxy.h" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size); + +namespace fuzzer { +namespace ipc { + +class RemoteAdapter final { +public: + RemoteAdapter() : TestInput(Available) {} + ~RemoteAdapter() = default; + + void TestOneInput() { + size_t Size; + int N; + RETRY_ON_EINTR(N, read(ProxyAdapter::kTestInputReader, &Size, sizeof(Size))); + if (N < 0) { + perror("read"); + exit(1); + } + if (N == 0) + exit(0); + if (static_cast(N) != sizeof(Size)) { + fprintf(stderr, "==%d== ERROR: incomplete read of test input size: %d of %zu bytes.\n", getpid(), N, sizeof(Size)); + exit(1); + } + + while (Available < Size) + Available *= 2; + if (TestInput.size() < Available) + TestInput.resize(Available); + uint8_t *Data = &TestInput[0]; + if (Size) { + RETRY_ON_EINTR(N, read(ProxyAdapter::kTestInputReader, Data, Size)); + if (N < 0) { + perror("read"); + exit(1); + } + if (size_t(N) != Size) { + fprintf(stderr, "==%d== ERROR: incomplete read of test input data: %d of %zu bytes.\n", getpid(), N, Size); + exit(1); + } + } + if (Size < Available) + ASAN_POISON_MEMORY_REGION(Data + Size, Available - Size); + int Result = LLVMFuzzerTestOneInput(Data, Size); + if (Size < Available) + ASAN_UNPOISON_MEMORY_REGION(Data + Size, Available - Size); + RETRY_ON_EINTR(N, write(ProxyAdapter::kResultWriter, &Result, sizeof(Result))); + if (N < 0) { + perror("write"); + exit(1); + } + if (N != sizeof(Result)) { + fprintf(stderr, "==%d== ERROR: incomplete write of test result: %d of %zu bytes.\n", getpid(), N, sizeof(Result)); + exit(1); + } + } + +private: + size_t Available = 1024; + std::vector TestInput; +}; + +} // namespace ipc +} // namespace fuzzer + +int main(int argc, char **argv) { + fuzzer::ipc::RemoteAdapter Remote; + while (true) + Remote.TestOneInput(); +} + +#endif // __linux__ Index: compiler-rt/test/fuzzer/ReloadTest.cpp =================================================================== --- compiler-rt/test/fuzzer/ReloadTest.cpp +++ compiler-rt/test/fuzzer/ReloadTest.cpp @@ -9,16 +9,20 @@ #include #include +#ifndef FUZZER_IPC_REMOTE extern "C" size_t LLVMFuzzerCustomMutator(uint8_t *Data, size_t Size, size_t MaxSize, unsigned int Seed) { std::srand(Seed); std::generate(Data, Data + MaxSize, std::rand); return MaxSize; } +#endif // !FUZZER_IPC_REMOTE +#ifndef FUZZER_IPC_PROXY extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { if (Size > 5000 && std::set(Data, Data + Size).size() > 255 && (uint8_t)std::accumulate(Data, Data + Size, uint8_t(Size)) == 0) abort(); return 0; } +#endif // !FUZZER_IPC_PROXY Index: compiler-rt/test/fuzzer/bcmp.test =================================================================== --- compiler-rt/test/fuzzer/bcmp.test +++ compiler-rt/test/fuzzer/bcmp.test @@ -1,4 +1,8 @@ UNSUPPORTED: darwin, freebsd, windows + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + RUN: %cpp_compiler -DMEMCMP=bcmp %S/MemcmpTest.cpp -o %t RUN: not %run %t -seed=1 -runs=10000000 2>&1 | FileCheck %s CHECK: BINGO Index: compiler-rt/test/fuzzer/bogus-initialize-remote.test =================================================================== --- /dev/null +++ compiler-rt/test/fuzzer/bogus-initialize-remote.test @@ -0,0 +1,6 @@ +REQUIRES: remote + +RUN: %proxy_compiler %S/BogusInitializeTest.cpp -o %t-Proxy +RUN: %cpp_compiler %S/SimpleTest.cpp -o %t-BogusInitializeTest + +RUN: not %run_no_proxy %t-Proxy %t-BogusInitializeTest 2>&1 | FileCheck %S/bogus-initialize.test --check-prefix=BOGUS_INITIALIZE Index: compiler-rt/test/fuzzer/bogus-initialize.test =================================================================== --- compiler-rt/test/fuzzer/bogus-initialize.test +++ compiler-rt/test/fuzzer/bogus-initialize.test @@ -1,3 +1,5 @@ +UNSUPPORTED: remote + RUN: %cpp_compiler %S/BogusInitializeTest.cpp -o %t-BogusInitializeTest RUN: not %run %t-BogusInitializeTest 2>&1 | FileCheck %s --check-prefix=BOGUS_INITIALIZE Index: compiler-rt/test/fuzzer/buffer-overflow-on-input.test =================================================================== --- compiler-rt/test/fuzzer/buffer-overflow-on-input.test +++ compiler-rt/test/fuzzer/buffer-overflow-on-input.test @@ -1,3 +1,4 @@ +UNSUPPORTED: remote RUN: %cpp_compiler %S/BufferOverflowOnInput.cpp -o %t-BufferOverflowOnInput RUN: not %run %t-BufferOverflowOnInput 2>&1 | FileCheck %s --check-prefix=OOB Index: compiler-rt/test/fuzzer/cleanse.test =================================================================== --- compiler-rt/test/fuzzer/cleanse.test +++ compiler-rt/test/fuzzer/cleanse.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/CleanseTest.cpp -o %t-CleanseTest RUN: echo -n 0123456789ABCDEFGHIZ > %t-in RUN: %run %t-CleanseTest -cleanse_crash=1 %t-in -exact_artifact_path=%t-out Index: compiler-rt/test/fuzzer/compressed-remote.test =================================================================== --- /dev/null +++ compiler-rt/test/fuzzer/compressed-remote.test @@ -0,0 +1,12 @@ +REQUIRES: linux +REQUIRES: remote +REQUIRES: zlib +# zlib is "supported" on i386 even when only for x86_64, explicitly make i386 +# unsupported by this test. +UNSUPPORTED: i386 +# Custom mutator should find this bug, w/o custom -- no chance. +RUN: %proxy_compiler %S/IPCProxyDefault.cpp %S/CompressedTest.cpp -o %t-ProxyCustom -DCUSTOM_MUTATOR -lz +RUN: %proxy_compiler %S/IPCProxyDefault.cpp %S/CompressedTest.cpp -o %t-ProxyPlain -lz +RUN: %cpp_compiler %S/CompressedTest.cpp -o %t-CompressedTest -lz +RUN: not %no_proxy_run %t-ProxyCustom %t-CompressedTest -seed=1 -runs=1000000 +RUN: %no_proxy_run %t-ProxyPlain %t-CompressedTest -seed=1 -runs=1000000 Index: compiler-rt/test/fuzzer/compressed.test =================================================================== --- compiler-rt/test/fuzzer/compressed.test +++ compiler-rt/test/fuzzer/compressed.test @@ -3,6 +3,7 @@ # zlib is "supported" on i386 even when only for x86_64, explicitly make i386 # unsupported by this test. UNSUPPORTED: i386 +UNSUPPORTED: remote # Custom mutator should find this bug, w/o custom -- no chance. RUN: %cpp_compiler %S/CompressedTest.cpp -o %t-CompressedTestCustom -DCUSTOM_MUTATOR -lz RUN: %cpp_compiler %S/CompressedTest.cpp -o %t-CompressedTestPlain -lz Index: compiler-rt/test/fuzzer/counters.test =================================================================== --- compiler-rt/test/fuzzer/counters.test +++ compiler-rt/test/fuzzer/counters.test @@ -1,4 +1,8 @@ UNSUPPORTED: aarch64, ios + +# FIXME: Fix remote symbolization +UNSUPPORTED: remote + RUN: %cpp_compiler %S/CounterTest.cpp -o %t-CounterTest RUN: not %run %t-CounterTest -max_len=6 -seed=1 -timeout=15 2>&1 | FileCheck %s --check-prefix=COUNTERS Index: compiler-rt/test/fuzzer/coverage.test =================================================================== --- compiler-rt/test/fuzzer/coverage.test +++ compiler-rt/test/fuzzer/coverage.test @@ -2,6 +2,8 @@ UNSUPPORTED: windows # FIXME: CreatePCArray() emits PLT stub addresses for entry blocks, which are ignored by TracePC::PrintCoverage(). XFAIL: s390x +# FIXME: Fix remote symbolization +UNSUPPORTED: remote RUN: %cpp_compiler -mllvm -use-unknown-locations=Disable %S/NullDerefTest.cpp -o %t-NullDerefTest RUN: %cpp_compiler -mllvm -use-unknown-locations=Disable %S/DSO1.cpp -fPIC %ld_flags_rpath_so1 -O0 -shared -o %dynamiclib1 RUN: %cpp_compiler -mllvm -use-unknown-locations=Disable %S/DSO2.cpp -fPIC %ld_flags_rpath_so2 -O0 -shared -o %dynamiclib2 Index: compiler-rt/test/fuzzer/cross_over_uniform_dist.test =================================================================== --- compiler-rt/test/fuzzer/cross_over_uniform_dist.test +++ compiler-rt/test/fuzzer/cross_over_uniform_dist.test @@ -1,6 +1,9 @@ REQUIRES: linux, x86_64 RUN: %cpp_compiler %S/KeepSeedTest.cpp -o %t-CrossOverUniformDistTest +# FIXME: Need value-profile support for remote fuzzing; otherwise too slow. +UNSUPPORTED: remote + RUN: rm -rf %t-corpus RUN: mkdir %t-corpus RUN: echo -n "@SELECT" > %t-corpus/A Index: compiler-rt/test/fuzzer/cxxstring.test =================================================================== --- compiler-rt/test/fuzzer/cxxstring.test +++ compiler-rt/test/fuzzer/cxxstring.test @@ -1,5 +1,8 @@ UNSUPPORTED: freebsd +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/CxxStringEqTest.cpp -o %t-CxxStringEqTest RUN: not %run %t-CxxStringEqTest -seed=1 -runs=1000000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/dataflow.test =================================================================== --- compiler-rt/test/fuzzer/dataflow.test +++ compiler-rt/test/fuzzer/dataflow.test @@ -1,6 +1,9 @@ # Tests the data flow tracer. REQUIRES: linux, x86_64 +# FIXME: Needs dataflow-tracing support for remote fuzzing. +UNSUPPORTED: remote + # Build the tracer and the test. RUN: %no_fuzzer_cpp_compiler -c -fno-sanitize=all -fsanitize=dataflow -mllvm -dfsan-fast-16-labels %S/../../lib/fuzzer/dataflow/DataFlow.cpp -o %t-DataFlow.o RUN: %no_fuzzer_cpp_compiler -c -fno-sanitize=all -fPIC %S/../../lib/fuzzer/dataflow/DataFlowCallbacks.cpp -o %t-DataFlowCallbacks.o Index: compiler-rt/test/fuzzer/deep-recursion.test =================================================================== --- compiler-rt/test/fuzzer/deep-recursion.test +++ compiler-rt/test/fuzzer/deep-recursion.test @@ -1,5 +1,9 @@ # Test that we can find a stack overflow REQUIRES: linux + +# FIXME: Needs stack-depth feature support for remote fuzzing. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/DeepRecursionTest.cpp -o %t RUN: not %run %t -seed=1 -runs=100000000 2>&1 | FileCheck %s CHECK: ERROR: libFuzzer: deadly signal Index: compiler-rt/test/fuzzer/deprecated-instrumentation.test =================================================================== --- compiler-rt/test/fuzzer/deprecated-instrumentation.test +++ compiler-rt/test/fuzzer/deprecated-instrumentation.test @@ -1,4 +1,4 @@ CHECK: -fsanitize-coverage=trace-pc is no longer supported by libFuzzer -RUN: %cpp_compiler %S/SimpleTest.cpp -c -o %t-SimpleTest.o -fsanitize-coverage=trace-pc +RUN: %no_remote_cpp_compiler %S/SimpleTest.cpp -c -o %t-SimpleTest.o -fsanitize-coverage=trace-pc RUN: %cpp_compiler %t-SimpleTest.o -o %t-SimpleTest RUN: not %run %t-SimpleTest 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/disable-leaks-remote.test =================================================================== --- /dev/null +++ compiler-rt/test/fuzzer/disable-leaks-remote.test @@ -0,0 +1,9 @@ +REQUIRES: lsan +REQUIRES: remote +UNSUPPORTED: aarch64 + +RUN: %proxy_compiler -fsanitize=address %S/IPCProxyDefault.cpp -o %t-Proxy +RUN: %cpp_compiler %S/AccumulateAllocationsTest.cpp -o %t-AccumulateAllocationsTest +RUN: %no_proxy_run %t-Proxy %t-AccumulateAllocationsTest -detect_leaks=1 -runs=100000 2>&1 | \ + FileCheck %S/disable-leaks.test --check-prefix=ACCUMULATE_ALLOCS + Index: compiler-rt/test/fuzzer/disable-leaks.test =================================================================== --- compiler-rt/test/fuzzer/disable-leaks.test +++ compiler-rt/test/fuzzer/disable-leaks.test @@ -1,5 +1,7 @@ REQUIRES: lsan UNSUPPORTED: aarch64 +UNSUPPORTED: remote + RUN: %cpp_compiler %S/AccumulateAllocationsTest.cpp -o %t-AccumulateAllocationsTest RUN: %run %t-AccumulateAllocationsTest -detect_leaks=1 -runs=100000 2>&1 | FileCheck %s --check-prefix=ACCUMULATE_ALLOCS ACCUMULATE_ALLOCS: INFO: libFuzzer disabled leak detection after every mutation Index: compiler-rt/test/fuzzer/dso.test =================================================================== --- compiler-rt/test/fuzzer/dso.test +++ compiler-rt/test/fuzzer/dso.test @@ -1,5 +1,7 @@ # FIXME: Disabled on Windows because -fPIC cannot be used to compile for Windows. UNSUPPORTED: windows +#FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED:remote RUN: %cpp_compiler %S/DSO1.cpp -fPIC %ld_flags_rpath_so1 -shared -o %dynamiclib1 RUN: %cpp_compiler %S/DSO2.cpp -fPIC %ld_flags_rpath_so2 -shared -o %dynamiclib2 RUN: %cpp_compiler %S/DSOTestMain.cpp %S/DSOTestExtra.cpp %ld_flags_rpath_exe1 %ld_flags_rpath_exe2 -o %t-DSOTest Index: compiler-rt/test/fuzzer/entropic-scale-per-exec-time.test =================================================================== --- compiler-rt/test/fuzzer/entropic-scale-per-exec-time.test +++ compiler-rt/test/fuzzer/entropic-scale-per-exec-time.test @@ -1,4 +1,8 @@ REQUIRES: linux, x86_64 + +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/EntropicScalePerExecTimeTest.cpp -o %t-EntropicScalePerExecTimeTest RUN: not %run %t-EntropicScalePerExecTimeTest -entropic=1 -entropic_scale_per_exec_time=1 -seed=1 -runs=100000 -max_len=10 Index: compiler-rt/test/fuzzer/exit_on_src_pos.test =================================================================== --- compiler-rt/test/fuzzer/exit_on_src_pos.test +++ compiler-rt/test/fuzzer/exit_on_src_pos.test @@ -3,6 +3,10 @@ # TODO: Find out why test fails on Darwin with -O2. # Binaries must end in .exe or else symbolization will break on Windows because of how periods # in expansion of %t cause the compiler to overwrite .lib and .exp files. + +# FIXME: Fix remote symbolization +UNSUPPORTED: remote + RUN: %cpp_compiler -O0 %S/SimpleTest.cpp -o %t-SimpleTest.exe -mllvm -use-unknown-locations=Disable RUN: %cpp_compiler -O0 %S/ShrinkControlFlowTest.cpp -o %t-ShrinkControlFlowTest.exe Index: compiler-rt/test/fuzzer/extra-counters.test =================================================================== --- compiler-rt/test/fuzzer/extra-counters.test +++ compiler-rt/test/fuzzer/extra-counters.test @@ -1,5 +1,8 @@ REQUIRES: linux +# FIXME: Add extra counter support for remote fuzzers +UNSUPPORTED: remote + RUN: %cpp_compiler %S/TableLookupTest.cpp -o %t-TableLookupTest RUN: not %run %t-TableLookupTest -print_final_stats=1 2>&1 | FileCheck %s CHECK: INFO: {{[0-9]+}} Extra Counters Index: compiler-rt/test/fuzzer/focus-function.test =================================================================== --- compiler-rt/test/fuzzer/focus-function.test +++ compiler-rt/test/fuzzer/focus-function.test @@ -4,6 +4,9 @@ # REQUIRES: linux UNSUPPORTED: aarch64 +# FIXME: Fix remote symbolization +UNSUPPORTED: remote + RUN: %cpp_compiler %S/OnlySomeBytesTest.cpp -o %t-exe RUN: %t-exe -runs=100 2>&1 | FileCheck %s --check-prefix=FOCUS_NONE Index: compiler-rt/test/fuzzer/fork-ubsan.test =================================================================== --- compiler-rt/test/fuzzer/fork-ubsan.test +++ compiler-rt/test/fuzzer/fork-ubsan.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers +UNSUPPORTED: remote + # UNSUPPORTED: darwin, freebsd, aarch64 # Tests how the fork mode works together with ubsan. RUN: %cpp_compiler %S/IntegerOverflowTest.cpp -o %t-IntegerOverflowTest -fsanitize=signed-integer-overflow -fno-sanitize-recover=signed-integer-overflow Index: compiler-rt/test/fuzzer/fork.test =================================================================== --- compiler-rt/test/fuzzer/fork.test +++ compiler-rt/test/fuzzer/fork.test @@ -1,3 +1,8 @@ +REQUIRES: expensive_checks + +# TODO: haven't tested yet (expensive) +UNSUPPORTED: remote + # UNSUPPORTED: darwin, freebsd, aarch64 BINGO: BINGO RUN: %cpp_compiler %S/SimpleTest.cpp -o %t-SimpleTest Index: compiler-rt/test/fuzzer/full-coverage.test =================================================================== --- compiler-rt/test/fuzzer/full-coverage.test +++ compiler-rt/test/fuzzer/full-coverage.test @@ -1,7 +1,12 @@ # FIXME: Disabled on Windows because -fPIC cannot be used to compile for Windows. UNSUPPORTED: windows + # FIXME: See coverage.test. Using UNSUPPORTED here due to random failures. UNSUPPORTED: s390x + +# FIXME: Fix remote symbolization +UNSUPPORTED: remote + RUN: %cpp_compiler %S/DSO1.cpp -fPIC %ld_flags_rpath_so1 -O0 -shared -o %dynamiclib1 RUN: %cpp_compiler %S/DSO2.cpp -fPIC %ld_flags_rpath_so2 -O0 -shared -o %dynamiclib2 RUN: %cpp_compiler %S/DSOTestMain.cpp %S/DSOTestExtra.cpp %ld_flags_rpath_exe1 %ld_flags_rpath_exe2 -o %t-DSOTest Index: compiler-rt/test/fuzzer/fuzzer-alignment-assumption.test =================================================================== --- compiler-rt/test/fuzzer/fuzzer-alignment-assumption.test +++ compiler-rt/test/fuzzer/fuzzer-alignment-assumption.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + RUN: rm -f %t-AlignmentAssumptionTest-Ubsan RUN: %cpp_compiler -fsanitize=alignment -fno-sanitize-recover=all %S/AlignmentAssumptionTest.cpp -o %t-AlignmentAssumptionTest-Ubsan RUN: not %run %t-AlignmentAssumptionTest-Ubsan 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/fuzzer-customcrossover-remote.test =================================================================== --- /dev/null +++ compiler-rt/test/fuzzer/fuzzer-customcrossover-remote.test @@ -0,0 +1,8 @@ +REQUIRES: remote + +RUN: %proxy_compiler %S/IPCProxyDefault.cpp %S/CustomCrossOverTest.cpp -o %t-Proxy +RUN: %cpp_compiler %S/CustomCrossOverTest.cpp -o %t-CustomCrossOverTest + +RUN: not %no_proxy_run %t-CustomCrossOverTest -seed=1 -runs=1000000 2>&1 | FileCheck %S/fuzzer-customcrossover.test --check-prefix=CHECK_CO +# Disable cross_over, verify that we can't find the target w/o it. +RUN: %no_proxy_run %t-CustomCrossOverTest -seed=1 -runs=1000000 -cross_over=0 2>&1 | FileCheck %S/fuzzer-customcrossover.test --check-prefix=CHECK_NO_CO Index: compiler-rt/test/fuzzer/fuzzer-customcrossover.test =================================================================== --- compiler-rt/test/fuzzer/fuzzer-customcrossover.test +++ compiler-rt/test/fuzzer/fuzzer-customcrossover.test @@ -1,3 +1,5 @@ +UNSUPPORTED: remote + RUN: %cpp_compiler %S/CustomCrossOverTest.cpp -o %t-CustomCrossOverTest RUN: not %run %t-CustomCrossOverTest -seed=1 -runs=1000000 2>&1 | FileCheck %s --check-prefix=CHECK_CO @@ -9,4 +11,3 @@ CHECK_NO_CO-NO: LLVMFuzzerCustomCrossover CHECK_NO_CO: DONE - Index: compiler-rt/test/fuzzer/fuzzer-customcrossoverandmutate-remote.test =================================================================== --- /dev/null +++ compiler-rt/test/fuzzer/fuzzer-customcrossoverandmutate-remote.test @@ -0,0 +1,3 @@ +RUN: %proxy_compiler %S/IPCProxyDefault.cpp %S/CustomCrossOverAndMutateTest.cpp -o %t-Proxy +RUN: %cpp_compiler %S/CustomCrossOverAndMutateTest.cpp -o %t-CustomCrossOverAndMutateTest +RUN: %no_proxy_run %t-Proxy %t-CustomCrossOverAndMutateTest -seed=1 -runs=100000 Index: compiler-rt/test/fuzzer/fuzzer-customcrossoverandmutate.test =================================================================== --- compiler-rt/test/fuzzer/fuzzer-customcrossoverandmutate.test +++ compiler-rt/test/fuzzer/fuzzer-customcrossoverandmutate.test @@ -1,2 +1,4 @@ +UNSUPPORTED: remote + RUN: %cpp_compiler %S/CustomCrossOverAndMutateTest.cpp -o %t-CustomCrossOverAndMutateTest RUN: %run %t-CustomCrossOverAndMutateTest -seed=1 -runs=100000 Index: compiler-rt/test/fuzzer/fuzzer-custommutator-remote.test =================================================================== --- /dev/null +++ compiler-rt/test/fuzzer/fuzzer-custommutator-remote.test @@ -0,0 +1,19 @@ +RUN: %proxy_compiler %S/IPCProxyDefault.cpp %S/CustomMutatorTest.cpp -o %t-Proxy +RUN: %cpp_compiler %S/CustomMutatorTest.cpp -o %t-CustomMutatorTest +RUN: not %no_proxy_run %t-CustomMutatorTest 2>&1 | \ + FileCheck %S/fuzzer-custommutator.test --check-prefix=LLVMFuzzerCustomMutator + +# len_control is disabled for custom mutators by default, test that it can be enabled. +RUN: not %no_proxy_run %t-CustomMutatorTest -len_control=1000 2>&1 | \ + FileCheck %S/fuzzer-custommutator.test --check-prefix=LLVMFuzzerCustomMutatorWithLenControl + +# sanity check: verify that we do get long lines with verbose printing on +RUN: %proxy_compiler %S/IPCProxyDefault.cpp %S/CustomMutatorWithLongSequencesTest.cpp -o %t-LongProxy +RUN: %cpp_compiler %S/CustomMutatorWithLongSequencesTest.cpp -o %t-CustomMutatorWithLongSequencesTest +RUN: not %no_proxy_run %t-LongProxy %t-CustomMutatorWithLongSequencesTest -verbosity=2 2>&1 | \ + FileCheck %S/fuzzer-custommutator.test --check-prefix=LLVMFuzzerCustomMutatorLongSequence + +# check a target that prints long mutation sequences and verifies the printed +# output is capped at 10 entries +RUN: not %no_proxy_run %t-CustomMutatorWithLongSequencesTest 2>&1 | \ + FileCheck %S/fuzzer-custommutator.test --check-prefix=LLVMFuzzerCustomMutatorLongSequenceTrimmed Index: compiler-rt/test/fuzzer/fuzzer-custommutator.test =================================================================== --- compiler-rt/test/fuzzer/fuzzer-custommutator.test +++ compiler-rt/test/fuzzer/fuzzer-custommutator.test @@ -1,3 +1,5 @@ +UNSUPPORTED: remote + RUN: %cpp_compiler %S/CustomMutatorTest.cpp -o %t-CustomMutatorTest RUN: not %run %t-CustomMutatorTest 2>&1 | FileCheck %s --check-prefix=LLVMFuzzerCustomMutator LLVMFuzzerCustomMutator: INFO: found LLVMFuzzerCustomMutator Index: compiler-rt/test/fuzzer/fuzzer-flags.test =================================================================== --- compiler-rt/test/fuzzer/fuzzer-flags.test +++ compiler-rt/test/fuzzer/fuzzer-flags.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/FlagsTest.cpp -o %t-FlagsTest RUN: %run %t-FlagsTest -runs=10 -foo_bar=1 2>&1 | FileCheck %s --check-prefix=FOO_BAR FOO_BAR: WARNING: unrecognized flag '-foo_bar=1'; use -help=1 to list all flags Index: compiler-rt/test/fuzzer/fuzzer-implicit-integer-sign-change.test =================================================================== --- compiler-rt/test/fuzzer/fuzzer-implicit-integer-sign-change.test +++ compiler-rt/test/fuzzer/fuzzer-implicit-integer-sign-change.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + RUN: rm -f %t-ImplicitIntegerSignChangeTest-Ubsan RUN: %cpp_compiler -fsanitize=implicit-integer-sign-change -fno-sanitize-recover=all %S/ImplicitIntegerSignChangeTest.cpp -o %t-ImplicitIntegerSignChangeTest-Ubsan RUN: not %run %t-ImplicitIntegerSignChangeTest-Ubsan 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/fuzzer-implicit-signed-integer-truncation-or-sign-change.test =================================================================== --- compiler-rt/test/fuzzer/fuzzer-implicit-signed-integer-truncation-or-sign-change.test +++ compiler-rt/test/fuzzer/fuzzer-implicit-signed-integer-truncation-or-sign-change.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + RUN: rm -f %t-ImplicitSignedIntegerTruncationOrSignChangeTest-Ubsan RUN: %cpp_compiler -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=all %S/ImplicitSignedIntegerTruncationOrSignChangeTest.cpp -o %t-ImplicitSignedIntegerTruncationOrSignChangeTest-Ubsan RUN: not %run %t-ImplicitSignedIntegerTruncationOrSignChangeTest-Ubsan 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/fuzzer-implicit-signed-integer-truncation.test =================================================================== --- compiler-rt/test/fuzzer/fuzzer-implicit-signed-integer-truncation.test +++ compiler-rt/test/fuzzer/fuzzer-implicit-signed-integer-truncation.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + RUN: rm -f %t-ImplicitSignedIntegerTruncationTest-Ubsan RUN: %cpp_compiler -fsanitize=implicit-signed-integer-truncation -fno-sanitize-recover=all %S/ImplicitSignedIntegerTruncationTest.cpp -o %t-ImplicitSignedIntegerTruncationTest-Ubsan RUN: not %run %t-ImplicitSignedIntegerTruncationTest-Ubsan 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/fuzzer-implicit-unsigned-integer-truncation.test =================================================================== --- compiler-rt/test/fuzzer/fuzzer-implicit-unsigned-integer-truncation.test +++ compiler-rt/test/fuzzer/fuzzer-implicit-unsigned-integer-truncation.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + RUN: rm -f %t-ImplicitUnsignedIntegerTruncationTest-Ubsan RUN: %cpp_compiler -fsanitize=implicit-unsigned-integer-truncation -fno-sanitize-recover=all %S/ImplicitUnsignedIntegerTruncationTest.cpp -o %t-ImplicitUnsignedIntegerTruncationTest-Ubsan RUN: not %run %t-ImplicitUnsignedIntegerTruncationTest-Ubsan 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/fuzzer-leak-remote.test =================================================================== --- /dev/null +++ compiler-rt/test/fuzzer/fuzzer-leak-remote.test @@ -0,0 +1,40 @@ +REQUIRES: lsan +REQUIRES: remote + +RUN: %proxy_compiler -fsanitize=address %S/IPCProxyDefault.cpp -o %t-Proxy +RUN: %cpp_compiler %S/LeakTest.cpp -o %t-LeakTest +RUN: %cpp_compiler %S/ThreadedLeakTest.cpp -o %t-ThreadedLeakTest +RUN: %cpp_compiler %S/LeakTimeoutTest.cpp -o %t-LeakTimeoutTest + +RUN: rm -rf %t-corpus && mkdir -p %t-corpus + +RUN: not %no_proxy_run %t-Proxy %t-LeakTest -runs=100000 -detect_leaks=1 %t-corpus 2>&1 | \ + FileCheck %S/fuzzer-leak.test --check-prefix=LEAK_DURING + +RUN: %no_proxy_run %t-Proxy %t-LeakTest -runs=0 %t-corpus + +RUN: not %no_proxy_run %t-Proxy %t-LeakTest -runs=0 -detect_leaks=1 %S 2>&1 | \ + FileCheck %S/fuzzer-leak.test --check-prefix=LEAK_IN_CORPUS + +RUN: not %no_proxy_run %t-Proxy %t-LeakTest -runs=100000000 %S/hi.txt 2>&1 | \ + FileCheck %S/fuzzer-leak.test --check-prefix=MULTI_RUN_LEAK + +RUN: not %no_proxy_run %t-Proxy %t-LeakTest -runs=100000 -detect_leaks=0 2>&1 | \ + FileCheck %S/fuzzer-leak.test --check-prefix=LEAK_AFTER + +RUN: not %no_proxy_run %t-Proxy %t-LeakTest -runs=100000 2>&1 | \ + FileCheck %S/fuzzer-leak.test --check-prefix=LEAK_DURING + +RUN: not %no_proxy_run %t-Proxy %t-ThreadedLeakTest -runs=100000 -detect_leaks=0 2>&1 | \ + FileCheck %S/fuzzer-leak.test --check-prefix=LEAK_AFTER + +RUN: not %no_proxy_run %t-Proxy %t-ThreadedLeakTest -runs=100000 2>&1 | \ + FileCheck %S/fuzzer-leak.test --check-prefix=LEAK_DURING + +RUN: not %no_proxy_run %t-Proxy %t-LeakTest -runs=100000 -max_len=1 2>&1 | \ + FileCheck %S/fuzzer-leak.test --check-prefix=MAX_LEN_1 + +RUN: not %no_proxy_run %t-Proxy %t-LeakTimeoutTest -timeout=1 2>&1 | \ + FileCheck %S/fuzzer-leak.test --check-prefix=LEAK_TIMEOUT + +RUN: %no_proxy_run %t-Proxy %t-LeakTest -error_exitcode=0 Index: compiler-rt/test/fuzzer/fuzzer-leak.test =================================================================== --- compiler-rt/test/fuzzer/fuzzer-leak.test +++ compiler-rt/test/fuzzer/fuzzer-leak.test @@ -1,4 +1,5 @@ REQUIRES: lsan +UNSUPPORTED: remote RUN: %cpp_compiler %S/LeakTest.cpp -o %t-LeakTest RUN: %cpp_compiler %S/ThreadedLeakTest.cpp -o %t-ThreadedLeakTest Index: compiler-rt/test/fuzzer/fuzzer-oom.test =================================================================== --- compiler-rt/test/fuzzer/fuzzer-oom.test +++ compiler-rt/test/fuzzer/fuzzer-oom.test @@ -1,4 +1,5 @@ UNSUPPORTED: aarch64, ios + # Tests break on windows unless exe extension is used (because there are periods # in expansion of %t, the string after the period is interpreted as the file # extension, so each compilation will clobber the previous one's lib and exp Index: compiler-rt/test/fuzzer/fuzzer-printcovpcs.test =================================================================== --- compiler-rt/test/fuzzer/fuzzer-printcovpcs.test +++ compiler-rt/test/fuzzer/fuzzer-printcovpcs.test @@ -1,6 +1,8 @@ UNSUPPORTED: aarch64 + RUN: %cpp_compiler %S/SimpleTest.cpp -o %t-SimpleTest RUN: not %run %t-SimpleTest -print_pcs=1 -seed=1 2>&1 | FileCheck %s --check-prefix=PCS + PCS-NOT: NEW_PC PCS:INITED PCS:NEW_PC: {{0x[a-f0-9]+}} Index: compiler-rt/test/fuzzer/fuzzer-singleinputs.test =================================================================== --- compiler-rt/test/fuzzer/fuzzer-singleinputs.test +++ compiler-rt/test/fuzzer/fuzzer-singleinputs.test @@ -4,14 +4,14 @@ RUN: not %run %t-NullDerefTest %S/hi.txt 2>&1 | FileCheck %s --check-prefix=SingleInput SingleInput-NOT: Test unit written to ./crash- -RUN: rm -rf %tmp/SINGLE_INPUTS -RUN: mkdir -p %tmp/SINGLE_INPUTS -RUN: echo aaa > %tmp/SINGLE_INPUTS/aaa -RUN: echo bbb > %tmp/SINGLE_INPUTS/bbb -RUN: %run %t-SimpleTest %tmp/SINGLE_INPUTS/aaa %tmp/SINGLE_INPUTS/bbb 2>&1 | FileCheck %s --check-prefix=SINGLE_INPUTS -RUN: %run %t-SimpleTest -max_len=2 %tmp/SINGLE_INPUTS/aaa %tmp/SINGLE_INPUTS/bbb 2>&1 | FileCheck %s --check-prefix=SINGLE_INPUTS -RUN: rm -rf %tmp/SINGLE_INPUTS -SINGLE_INPUTS: SimpleTest{{.*}}: Running 2 inputs 1 time(s) each. +RUN: rm -rf %S/SINGLE_INPUTS +RUN: mkdir -p %S/SINGLE_INPUTS +RUN: echo aaa > %S/SINGLE_INPUTS/aaa +RUN: echo bbb > %S/SINGLE_INPUTS/bbb +RUN: %run %t-SimpleTest %S/SINGLE_INPUTS/aaa %S/SINGLE_INPUTS/bbb 2>&1 | FileCheck %s --check-prefix=SINGLE_INPUTS +RUN: %run %t-SimpleTest -max_len=2 %S/SINGLE_INPUTS/aaa %S/SINGLE_INPUTS/bbb 2>&1 | FileCheck %s --check-prefix=SINGLE_INPUTS +RUN: rm -rf %S/SINGLE_INPUTS +SINGLE_INPUTS: Running 2 inputs 1 time(s) each. SINGLE_INPUTS: aaa in SINGLE_INPUTS: bbb in SINGLE_INPUTS: NOTE: fuzzing was not performed, you have only Index: compiler-rt/test/fuzzer/fuzzer-ubsan.test =================================================================== --- compiler-rt/test/fuzzer/fuzzer-ubsan.test +++ compiler-rt/test/fuzzer/fuzzer-ubsan.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + RUN: %cpp_compiler -fsanitize=undefined -fno-sanitize-recover=all %S/SignedIntOverflowTest.cpp -o %t-SignedIntOverflowTest-Ubsan RUN: not %run %t-SignedIntOverflowTest-Ubsan 2>&1 | FileCheck %s CHECK: runtime error: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' Index: compiler-rt/test/fuzzer/initialize.test =================================================================== --- compiler-rt/test/fuzzer/initialize.test +++ compiler-rt/test/fuzzer/initialize.test @@ -1,3 +1,5 @@ +UNSUPPORTED: remote + CHECK: BINGO RUN: %cpp_compiler %S/InitializeTest.cpp -o %t-InitializeTest RUN: not %run %t-InitializeTest -use_value_profile=1 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/keep-seed.test =================================================================== --- compiler-rt/test/fuzzer/keep-seed.test +++ compiler-rt/test/fuzzer/keep-seed.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. Too slow? +UNSUPPORTED: remote + REQUIRES: linux, x86_64 RUN: %cpp_compiler %S/KeepSeedTest.cpp -o %t-KeepSeedTest Index: compiler-rt/test/fuzzer/large.test =================================================================== --- compiler-rt/test/fuzzer/large.test +++ compiler-rt/test/fuzzer/large.test @@ -1,4 +1,7 @@ -UNSUPPORTED: expensive_checks +REQUIRES: expensive_checks + +# TODO: haven't tested yet (expensive) +UNSUPPORTED: remote RUN: %cpp_compiler %S/LargeTest.cpp -o %t-LargeTest RUN: %run %t-LargeTest -runs=10000 Index: compiler-rt/test/fuzzer/lit.cfg.py =================================================================== --- compiler-rt/test/fuzzer/lit.cfg.py +++ compiler-rt/test/fuzzer/lit.cfg.py @@ -4,10 +4,17 @@ config.name = "libFuzzer" + config.name_suffix config.test_format = lit.formats.ShTest(True) -config.suffixes = ['.test'] config.test_source_root = os.path.dirname(__file__) config.available_features.add(config.target_arch) +if config.use_remote: + config.suffixes = ['.remote_test'] +else: + config.suffixes = ['.test'] + +# Comment out this line to disable expensive checks when debugging. +# config.available_features.add('expensive_checks') + # Choose between lit's internal shell pipeline runner and a real shell. If # LIT_USE_INTERNAL_SHELL is in the environment, we use that as an override. use_lit_shell = os.environ.get("LIT_USE_INTERNAL_SHELL") @@ -25,6 +32,17 @@ # the test runner updated. config.test_format = lit.formats.ShTest(execute_external) +# Note the value of ``sys.platform`` is not consistent +# between python 2 and 3, hence the use of ``.startswith()``. +if sys.platform.startswith('win') or sys.platform.startswith('cygwin'): + config.available_features.add('windows') + +if sys.platform.startswith('darwin'): + config.available_features.add('darwin') + +if sys.platform.startswith('linux'): + config.available_features.add('linux') + # LeakSanitizer is not supported on OSX or Windows right now. if (sys.platform.startswith('darwin') or sys.platform.startswith('freebsd') or @@ -34,7 +52,7 @@ lit_config.note('lsan feature available') config.available_features.add('lsan') -# MemorySanitizer is not supported on OSX or Windows right now +# MemorySanitizer is not supported on OSX or Windows right now. if (sys.platform.startswith('darwin') or sys.platform.startswith('win') or config.target_arch == 'i386'): lit_config.note('msan feature unavailable') @@ -43,69 +61,93 @@ lit_config.note('msan feature available') config.available_features.add('msan') -if sys.platform.startswith('win') or sys.platform.startswith('cygwin'): - config.available_features.add('windows') - -if sys.platform.startswith('darwin'): - config.available_features.add('darwin') - -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') +# Remote tests are only supported on Linux right now. +if config.use_remote: + lit_config.note('remote feature requested') + if sys.platform.startswith('linux'): + lit_config.note('remote feature available') + config.available_features.add('remote') + else: + lit_config.note('remote feature unavailable') + config.unsupported = True +libfuzzer_src_root = os.path.join(config.compiler_rt_src_root, 'lib', 'fuzzer') config.substitutions.append(('%build_dir', config.cmake_binary_dir)) -libfuzzer_src_root = os.path.join(config.compiler_rt_src_root, "lib", "fuzzer") config.substitutions.append(('%libfuzzer_src', libfuzzer_src_root)) -def generate_compiler_cmd(is_cpp=True, fuzzer_enabled=True, msan_enabled=False): - compiler_cmd = config.clang - extra_cmd = config.target_flags - +def generate_compiler_cmd(sanitizers=None, is_cpp=True, remote_mode='Remote'): + compiler_cmd = [ config.clang ] if is_cpp: - std_cmd = '--driver-mode=g++' - else: - std_cmd = '' - - if msan_enabled: - sanitizers = ['memory'] - else: - sanitizers = ['address'] - if fuzzer_enabled: - sanitizers.append('fuzzer') - sanitizers_cmd = ('-fsanitize=%s' % ','.join(sanitizers)) - return " ".join([ - compiler_cmd, - std_cmd, - "-O2 -gline-tables-only", - sanitizers_cmd, - "-I%s" % libfuzzer_src_root, - extra_cmd - ]) + compiler_cmd.append('--driver-mode=g++') + compiler_cmd.append('-O2') + compiler_cmd.append('-gline-tables-only') + compiler_cmd.append('-I%s' % libfuzzer_src_root) + + if config.use_remote and remote_mode and 'fuzzer' in sanitizers: + compiler_cmd.append('-fsanitize-coverage=inline-8bit-counters,pc-table') + sanitizers = [ s for s in sanitizers if s != 'fuzzer' ] + + if sanitizers: + compiler_cmd.append('-fsanitize=%s' % ','.join(sanitizers)) + + if config.use_remote and remote_mode: + compiler_cmd.append('-L%s' % + os.path.join(config.compiler_rt_obj_root, 'lib', 'fuzzer', 'ipc')) + compiler_cmd.append('-Wl,--whole-archive') + compiler_cmd.append('-lRTFuzzerIPC%s-%s' % (remote_mode, config.target_arch)) + compiler_cmd.append('-Wl,--no-whole-archive') + compiler_cmd.append('-lpthread') + compiler_cmd.append('-DFUZZER_IPC_%s' % remote_mode.upper()) + compiler_cmd.append('%%S/IPC%s.cpp' % remote_mode) + + return ' '.join(compiler_cmd) config.substitutions.append(('%cpp_compiler', - generate_compiler_cmd(is_cpp=True, fuzzer_enabled=True) + generate_compiler_cmd(sanitizers=['address', 'fuzzer']) )) config.substitutions.append(('%c_compiler', - generate_compiler_cmd(is_cpp=False, fuzzer_enabled=True) + generate_compiler_cmd(sanitizers=['address', 'fuzzer'], is_cpp=False) )) config.substitutions.append(('%no_fuzzer_cpp_compiler', - generate_compiler_cmd(is_cpp=True, fuzzer_enabled=False) + generate_compiler_cmd(sanitizers=['address'], remote_mode=None) )) config.substitutions.append(('%no_fuzzer_c_compiler', - generate_compiler_cmd(is_cpp=False, fuzzer_enabled=False) + generate_compiler_cmd(sanitizers=['address'], is_cpp=False, remote_mode=None) )) config.substitutions.append(('%msan_compiler', - generate_compiler_cmd(is_cpp=True, fuzzer_enabled=True, msan_enabled=True) + generate_compiler_cmd(sanitizers=['memory', 'fuzzer']) + )) + +config.substitutions.append(('%no_remote_cpp_compiler', + generate_compiler_cmd(sanitizers=['address', 'fuzzer'], remote_mode=None) )) +config.substitutions.append(('%no_remote_c_compiler', + generate_compiler_cmd(sanitizers=['address', 'fuzzer'], is_cpp=False, remote_mode=None) + )) + +# Remote fuzzer tests can either use the prebuilt default fuzzer proxy, e.g.: +# RUN: %copy_default_proxy +# or build their own, e.g.: +# RUN: %proxy_compiler %S/MyProxy.cpp -o %fuzzer_proxy +# When NOT testing remote fuzzers, these subsitutions are no-ops. +config.substitutions.append(('%fuzzer_proxy', '%t.FuzzerProxy')) +if config.use_remote: + config.substitutions.append(('%copy_default_proxy', + 'cp %s %%fuzzer_proxy' % + os.path.join(config.compiler_rt_obj_root, + 'test', 'fuzzer', 'FuzzerProxy-%s' % config.target_arch))) + config.substitutions.append(('%proxy_compiler', + generate_compiler_cmd(sanitizers=['fuzzer'], remote_mode='Proxy') + )) +else: + config.substitutions.append(('%copy_default_proxy', 'true')) + config.substitutions.append(('%proxy_compiler', 'true')) + default_asan_opts_str = ':'.join(config.default_sanitizer_opts) if default_asan_opts_str: config.environment['ASAN_OPTIONS'] = default_asan_opts_str @@ -116,5 +158,9 @@ if not config.parallelism_group: config.parallelism_group = 'shadow-memory' +run_prefixes = [] +if config.use_remote: + run_prefixes.append('%fuzzer_proxy') if config.host_os == 'NetBSD': - config.substitutions.insert(0, ('%run', config.netbsd_noaslr_prefix)) + run_prefixes.append(config.netbsd_noaslr_prefix) +config.substitutions.insert(0, ('%run', ' '.join(run_prefixes))) Index: compiler-rt/test/fuzzer/lit.site.cfg.py.in =================================================================== --- compiler-rt/test/fuzzer/lit.site.cfg.py.in +++ compiler-rt/test/fuzzer/lit.site.cfg.py.in @@ -14,6 +14,9 @@ config.target_triple = "@TARGET_TRIPLE@" config.target_arch = "@LIBFUZZER_TEST_TARGET_ARCH@" +config.use_remote = @LIBFUZZER_TEST_USE_REMOTE@ +config.libcxx_prefix = "@LIBFUZZER_TEST_LIBCXX_PREFIX@" + # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") Index: compiler-rt/test/fuzzer/magic-separator.test =================================================================== --- compiler-rt/test/fuzzer/magic-separator.test +++ compiler-rt/test/fuzzer/magic-separator.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. Too slow? +UNSUPPORTED: remote + # Temporary disable this test on non-linux: looks like there is no memmem on windows. REQUIRES: linux, x86_64 RUN: %cpp_compiler -O2 %S/MagicSeparatorTest.cpp -o %t-MagicSeparatorTest Index: compiler-rt/test/fuzzer/memcmp.test =================================================================== --- compiler-rt/test/fuzzer/memcmp.test +++ compiler-rt/test/fuzzer/memcmp.test @@ -1,4 +1,8 @@ UNSUPPORTED: freebsd + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/MemcmpTest.cpp -o %t-MemcmpTest RUN: not %run %t-MemcmpTest -seed=1 -runs=10000000 2>&1 | FileCheck %s CHECK: BINGO Index: compiler-rt/test/fuzzer/memcmp64.test =================================================================== --- compiler-rt/test/fuzzer/memcmp64.test +++ compiler-rt/test/fuzzer/memcmp64.test @@ -1,4 +1,8 @@ UNSUPPORTED: freebsd + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/Memcmp64BytesTest.cpp -o %t-Memcmp64BytesTest RUN: not %run %t-Memcmp64BytesTest -seed=1 -runs=1000000 2>&1 | FileCheck %s CHECK: BINGO Index: compiler-rt/test/fuzzer/merge-control-file.test =================================================================== --- compiler-rt/test/fuzzer/merge-control-file.test +++ compiler-rt/test/fuzzer/merge-control-file.test @@ -1,5 +1,9 @@ +# FIXME: Investigate why this fails for remote fuzzers +UNSUPPORTED: remote + XFAIL: ios RUN: mkdir -p %t + # Use a ".exe" extension because it is needed on Windows to call system() # to execute itself again. RUN: %cpp_compiler %S/FullCoverageSetTest.cpp -o %t/T.exe Index: compiler-rt/test/fuzzer/merge-sigusr.test =================================================================== --- compiler-rt/test/fuzzer/merge-sigusr.test +++ compiler-rt/test/fuzzer/merge-sigusr.test @@ -1,7 +1,11 @@ +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + # Check that libFuzzer honors SIGUSR1/SIGUSR2 # FIXME: Disabled on Windows for now because of reliance on posix only features # (eg: export, "&", pkill). UNSUPPORTED: darwin, windows + RUN: rm -rf %t RUN: mkdir -p %t RUN: %cpp_compiler %S/SleepOneSecondTest.cpp -o %t/LFSIGUSR Index: compiler-rt/test/fuzzer/merge.test =================================================================== --- compiler-rt/test/fuzzer/merge.test +++ compiler-rt/test/fuzzer/merge.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/FullCoverageSetTest.cpp -o %t-FullCoverageSetTest RUN: rm -rf %t/T0 %t/T1 %t/T2 Index: compiler-rt/test/fuzzer/merge_two_step.test =================================================================== --- compiler-rt/test/fuzzer/merge_two_step.test +++ compiler-rt/test/fuzzer/merge_two_step.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/FullCoverageSetTest.cpp -o %t-FullCoverageSetTest RUN: rm -rf %t/T0 %t/T1 %t/T2 Index: compiler-rt/test/fuzzer/minimize_crash.test =================================================================== --- compiler-rt/test/fuzzer/minimize_crash.test +++ compiler-rt/test/fuzzer/minimize_crash.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/NullDerefTest.cpp -o %t-NullDerefTest RUN: %cpp_compiler %S/SingleByteInputTest.cpp -o %t-SingleByteInputTest RUN: mkdir -p %t.dir Index: compiler-rt/test/fuzzer/minimize_timeout.test =================================================================== --- compiler-rt/test/fuzzer/minimize_timeout.test +++ compiler-rt/test/fuzzer/minimize_timeout.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/TimeoutTest.cpp -o %t-TimeoutTest RUN: mkdir -p %t.dir Index: compiler-rt/test/fuzzer/minimize_two_crashes.test =================================================================== --- compiler-rt/test/fuzzer/minimize_two_crashes.test +++ compiler-rt/test/fuzzer/minimize_two_crashes.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + # Test that the minimizer stops when it sees a different bug. UNSUPPORTED: freebsd Index: compiler-rt/test/fuzzer/msan-param-unpoison.test =================================================================== --- compiler-rt/test/fuzzer/msan-param-unpoison.test +++ compiler-rt/test/fuzzer/msan-param-unpoison.test @@ -1,4 +1,8 @@ REQUIRES: msan + +# FIXME: msan triggers false-positives with the TestProxy as written. +UNSUPPORTED: remote + RUN: %msan_compiler %S/MsanParamUnpoison.cpp -o %t RUN: %run %t -seed=1 -runs=1000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/msan.test =================================================================== --- compiler-rt/test/fuzzer/msan.test +++ compiler-rt/test/fuzzer/msan.test @@ -1,4 +1,8 @@ REQUIRES: msan + +# FIXME: msan triggers false-positives with the TestProxy as written. +UNSUPPORTED: remote + RUN: %msan_compiler %S/SimpleTestStdio.cpp -o %t RUN: not %run %t -seed=1 -runs=10000000 2>&1 | FileCheck %s --check-prefix=NO-REPORT Index: compiler-rt/test/fuzzer/noasan-bcmp.test =================================================================== --- compiler-rt/test/fuzzer/noasan-bcmp.test +++ compiler-rt/test/fuzzer/noasan-bcmp.test @@ -1,4 +1,8 @@ UNSUPPORTED: darwin, freebsd, windows + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + RUN: %cpp_compiler -fno-sanitize=address -DMEMCMP=bcmp %S/MemcmpTest.cpp -o %t RUN: not %run %t -seed=1 -runs=10000000 2>&1 | FileCheck %s CHECK: BINGO Index: compiler-rt/test/fuzzer/noasan-memcmp.test =================================================================== --- compiler-rt/test/fuzzer/noasan-memcmp.test +++ compiler-rt/test/fuzzer/noasan-memcmp.test @@ -1,5 +1,8 @@ UNSUPPORTED: darwin, freebsd, windows +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + RUN: %cpp_compiler -fno-sanitize=address %S/MemcmpTest.cpp -o %t-NoAsanMemcmpTest RUN: not %run %t-NoAsanMemcmpTest -seed=1 -runs=10000000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/noasan-memcmp64.test =================================================================== --- compiler-rt/test/fuzzer/noasan-memcmp64.test +++ compiler-rt/test/fuzzer/noasan-memcmp64.test @@ -1,5 +1,8 @@ UNSUPPORTED: darwin, freebsd, windows +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + RUN: %cpp_compiler -fno-sanitize=address %S/Memcmp64BytesTest.cpp -o %t-NoAsanMemcmp64BytesTest RUN: not %run %t-NoAsanMemcmp64BytesTest -seed=1 -runs=1000000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/noasan-strcmp.test =================================================================== --- compiler-rt/test/fuzzer/noasan-strcmp.test +++ compiler-rt/test/fuzzer/noasan-strcmp.test @@ -1,5 +1,8 @@ UNSUPPORTED: darwin, freebsd, windows +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + RUN: %cpp_compiler -fno-sanitize=address %S/StrcmpTest.cpp -o %t-NoAsanStrcmpTest RUN: not %run %t-NoAsanStrcmpTest -seed=1 -runs=2000000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/noasan-strncmp.test =================================================================== --- compiler-rt/test/fuzzer/noasan-strncmp.test +++ compiler-rt/test/fuzzer/noasan-strncmp.test @@ -1,5 +1,8 @@ UNSUPPORTED: darwin, freebsd, windows +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + RUN: %cpp_compiler -fno-sanitize=address %S/StrncmpTest.cpp -o %t-NoAsanStrncmpTest RUN: not %run %t-NoAsanStrncmpTest -seed=2 -runs=10000000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/noasan-strstr.test =================================================================== --- compiler-rt/test/fuzzer/noasan-strstr.test +++ compiler-rt/test/fuzzer/noasan-strstr.test @@ -1,5 +1,8 @@ UNSUPPORTED: darwin, freebsd, windows +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + RUN: %cpp_compiler -fno-sanitize=address %S/StrstrTest.cpp -o %t-NoAsanStrstrTest RUN: not %run %t-NoAsanStrstrTest -seed=1 -runs=2000000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/not-instrumented.test =================================================================== --- compiler-rt/test/fuzzer/not-instrumented.test +++ compiler-rt/test/fuzzer/not-instrumented.test @@ -1,4 +1,4 @@ -RUN: %cpp_compiler %S/NotinstrumentedTest.cpp -fsanitize-coverage=0 -o %t-NotinstrumentedTest-NoCoverage +RUN: %no_remote_cpp_compiler %S/NotinstrumentedTest.cpp -fsanitize-coverage=0 -o %t-NotinstrumentedTest-NoCoverage RUN: not %run %t-NotinstrumentedTest-NoCoverage 2>&1 | FileCheck %s --check-prefix=NO_COVERAGE NO_COVERAGE: ERROR: no interesting inputs were found. Is the code instrumented for coverage? Exiting Index: compiler-rt/test/fuzzer/null-deref.test =================================================================== --- compiler-rt/test/fuzzer/null-deref.test +++ compiler-rt/test/fuzzer/null-deref.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/NullDerefTest.cpp -o %t-NullDerefTest RUN: not %run %t-NullDerefTest 2>&1 | FileCheck %s --check-prefix=NullDerefTest Index: compiler-rt/test/fuzzer/only-some-bytes-fork.test =================================================================== --- compiler-rt/test/fuzzer/only-some-bytes-fork.test +++ compiler-rt/test/fuzzer/only-some-bytes-fork.test @@ -1,6 +1,9 @@ # Tests the data flow tracer. REQUIRES: linux, x86_64 +# FIXME: Needs dataflow-tracing support for remote fuzzing. +UNSUPPORTED: remote + # Build the tracer and the test. RUN: %no_fuzzer_cpp_compiler -c -fno-sanitize=all -fsanitize=dataflow -mllvm -dfsan-fast-16-labels %S/../../lib/fuzzer/dataflow/DataFlow.cpp -o %t-DataFlow.o RUN: %no_fuzzer_cpp_compiler -c -fno-sanitize=all -fPIC %S/../../lib/fuzzer/dataflow/DataFlowCallbacks.cpp -o %t-DataFlowCallbacks.o Index: compiler-rt/test/fuzzer/only-some-bytes.test =================================================================== --- compiler-rt/test/fuzzer/only-some-bytes.test +++ compiler-rt/test/fuzzer/only-some-bytes.test @@ -1,6 +1,9 @@ # Tests the data flow tracer. REQUIRES: linux, x86_64 +# FIXME: Needs dataflow-tracing support for remote fuzzing. +UNSUPPORTED: remote + # Build the tracer and the test. RUN: %no_fuzzer_cpp_compiler -c -fno-sanitize=all -fsanitize=dataflow -mllvm -dfsan-fast-16-labels %S/../../lib/fuzzer/dataflow/DataFlow.cpp -o %t-DataFlow.o RUN: %no_fuzzer_cpp_compiler -c -fno-sanitize=all -fPIC %S/../../lib/fuzzer/dataflow/DataFlowCallbacks.cpp -o %t-DataFlowCallbacks.o Index: compiler-rt/test/fuzzer/overwrite-input.test =================================================================== --- compiler-rt/test/fuzzer/overwrite-input.test +++ compiler-rt/test/fuzzer/overwrite-input.test @@ -1,3 +1,5 @@ +UNSUPPORTED: remote + RUN: %cpp_compiler %S/OverwriteInputTest.cpp -o %t-OverwriteInputTest RUN: not %run %t-OverwriteInputTest 2>&1 | FileCheck %s CHECK: ERROR: libFuzzer: fuzz target overwrites its const input Index: compiler-rt/test/fuzzer/print-func.test =================================================================== --- compiler-rt/test/fuzzer/print-func.test +++ compiler-rt/test/fuzzer/print-func.test @@ -1,4 +1,8 @@ UNSUPPORTED: darwin, aarch64 + +# FIXME: Fix remote symbolization +UNSUPPORTED: remote + RUN: %cpp_compiler %S/PrintFuncTest.cpp -o %t RUN: %run %t -seed=1 -runs=100000 2>&1 | FileCheck %s RUN: %run %t -seed=1 -runs=100000 -print_funcs=0 2>&1 | FileCheck %s --check-prefix=NO Index: compiler-rt/test/fuzzer/recommended-dictionary.test =================================================================== --- compiler-rt/test/fuzzer/recommended-dictionary.test +++ compiler-rt/test/fuzzer/recommended-dictionary.test @@ -1,3 +1,6 @@ +# FIXME: Currently too slow without remote fuzzing value-profile support. +UNSUPPORTED: remote + UNSUPPORTED: freebsd RUN: %cpp_compiler %S/RepeatedMemcmp.cpp -o %t-RepeatedMemcmp RUN: %run %t-RepeatedMemcmp -seed=11 -runs=100000 -max_len=20 2>&1 | FileCheck %s --check-prefix=RECOMMENDED_DICT Index: compiler-rt/test/fuzzer/reduce_inputs.test =================================================================== --- compiler-rt/test/fuzzer/reduce_inputs.test +++ compiler-rt/test/fuzzer/reduce_inputs.test @@ -1,5 +1,8 @@ # Test -reduce_inputs=1 +# FIXME: Add exit_on_item support for remote fuzzers. +UNSUPPORTED: remote + RUN: rm -rf %t/C RUN: mkdir -p %t/C RUN: %cpp_compiler %S/ShrinkControlFlowSimpleTest.cpp -o %t-ShrinkControlFlowSimpleTest Index: compiler-rt/test/fuzzer/reload-remote.test =================================================================== --- /dev/null +++ compiler-rt/test/fuzzer/reload-remote.test @@ -0,0 +1,18 @@ +REQUIRES: remote + +RUN: %proxy_compiler %S/IPCProxyDefault.cpp %S/ReloadTest.cpp -o %t-Proxy +RUN: %cpp_compiler %S/ReloadTest.cpp -o %t-ReloadTest +RUN: not %no_proxy_run %t-Proxy %t-ReloadTest -max_len=10000 -seed=1 -timeout=15 -len_control=0 \ + -exact_artifact_path=%t.crash 2>&1 | FileCheck %S/reload.test + +CHECK: Test unit written to {{.*}}reload.test.tmp.crash + +RUN: not %no_proxy_run %t-Proxy %t-ReloadTest %t.crash 2>&1 | \ + FileCheck %S/reload.test --check-prefix=ARTIFACT + +ARTIFACT: Running: {{.*}}reload.test.tmp.crash +ARTIFACT: ERROR: libFuzzer: deadly signal + +# Sanity check that altered artifact is not going to crash +RUN: echo z >> %t.crash +RUN: %no_proxy_run %t-Proxy %t-ReloadTest %t.crash Index: compiler-rt/test/fuzzer/reload.test =================================================================== --- compiler-rt/test/fuzzer/reload.test +++ compiler-rt/test/fuzzer/reload.test @@ -1,3 +1,5 @@ +UNSUPPORTED: remote + RUN: %cpp_compiler %S/ReloadTest.cpp -o %t-ReloadTest RUN: not %run %t-ReloadTest -max_len=10000 -seed=1 -timeout=15 -len_control=0 -exact_artifact_path=%t.crash 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/seed_inputs.test =================================================================== --- compiler-rt/test/fuzzer/seed_inputs.test +++ compiler-rt/test/fuzzer/seed_inputs.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + # Uses echo in a way that is not supported by the iOS "run-on-device" script. UNSUPPORTED: ios Index: compiler-rt/test/fuzzer/shrink.test =================================================================== --- compiler-rt/test/fuzzer/shrink.test +++ compiler-rt/test/fuzzer/shrink.test @@ -1,3 +1,6 @@ +# FIXME: Add exit_on_item support for remote fuzzers. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/ShrinkControlFlowTest.cpp -o %t-ShrinkControlFlowTest RUN: %cpp_compiler %S/ShrinkValueProfileTest.cpp -o %t-ShrinkValueProfileTest RUN: %run %t-ShrinkControlFlowTest -seed=1 -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=2000000 -shrink=1 -reduce_inputs=0 2>&1 | FileCheck %s --check-prefix=SHRINK1 Index: compiler-rt/test/fuzzer/sigint.test =================================================================== --- compiler-rt/test/fuzzer/sigint.test +++ compiler-rt/test/fuzzer/sigint.test @@ -1,5 +1,8 @@ REQUIRES: msan +# FIXME: msan triggers false-positives with the TestProxy as written. +UNSUPPORTED: remote + # Check that libFuzzer exits gracefully under SIGINT with MSan. RUN: rm -rf %t RUN: mkdir -p %t Index: compiler-rt/test/fuzzer/sigusr.test =================================================================== --- compiler-rt/test/fuzzer/sigusr.test +++ compiler-rt/test/fuzzer/sigusr.test @@ -1,6 +1,7 @@ # FIXME: Disabled on Windows for now because of reliance on posix only features # (eg: export, "&", pkill). UNSUPPORTED: darwin, windows + # Check that libFuzzer honors SIGUSR1/SIGUSR2 RUN: rm -rf %t RUN: mkdir -p %t Index: compiler-rt/test/fuzzer/simple-cmp.test =================================================================== --- compiler-rt/test/fuzzer/simple-cmp.test +++ compiler-rt/test/fuzzer/simple-cmp.test @@ -1,4 +1,8 @@ REQUIRES: linux, x86_64 + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/SimpleCmpTest.cpp -o %t-SimpleCmpTest RUN: not %run %t-SimpleCmpTest -seed=1 -runs=100000000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/standalone.test =================================================================== --- compiler-rt/test/fuzzer/standalone.test +++ compiler-rt/test/fuzzer/standalone.test @@ -1,3 +1,5 @@ +UNSUPPORTED: remote + RUN: %no_fuzzer_c_compiler %libfuzzer_src/standalone/StandaloneFuzzTargetMain.c -c -o %t_1.o RUN: %no_fuzzer_cpp_compiler %S/InitializeTest.cpp -c -o %t_2.o Index: compiler-rt/test/fuzzer/strcmp.test =================================================================== --- compiler-rt/test/fuzzer/strcmp.test +++ compiler-rt/test/fuzzer/strcmp.test @@ -1,4 +1,8 @@ UNSUPPORTED: freebsd + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/StrcmpTest.cpp -o %t-StrcmpTest RUN: not %run %t-StrcmpTest -seed=1 -runs=2000000 2>&1 | FileCheck %s CHECK: BINGO Index: compiler-rt/test/fuzzer/strncmp-oob.test =================================================================== --- compiler-rt/test/fuzzer/strncmp-oob.test +++ compiler-rt/test/fuzzer/strncmp-oob.test @@ -1,3 +1,6 @@ +# FIXME: Investigate why this fails for remote fuzzers. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/StrncmpOOBTest.cpp -o %t-StrncmpOOBTest RUN: %env_asan_opts=strict_string_checks=1 not %run %t-StrncmpOOBTest -seed=1 -runs=1000000 2>&1 | FileCheck %s --check-prefix=STRNCMP Index: compiler-rt/test/fuzzer/strncmp.test =================================================================== --- compiler-rt/test/fuzzer/strncmp.test +++ compiler-rt/test/fuzzer/strncmp.test @@ -1,4 +1,8 @@ UNSUPPORTED: freebsd + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/StrncmpTest.cpp -o %t-StrncmpTest RUN: not %run %t-StrncmpTest -seed=2 -runs=10000000 2>&1 | FileCheck %s CHECK: BINGO Index: compiler-rt/test/fuzzer/strstr.test =================================================================== --- compiler-rt/test/fuzzer/strstr.test +++ compiler-rt/test/fuzzer/strstr.test @@ -1,4 +1,8 @@ UNSUPPORTED: freebsd + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/StrstrTest.cpp -o %t-StrstrTest RUN: not %run %t-StrstrTest -seed=1 -runs=2000000 2>&1 | FileCheck %s CHECK: BINGO Index: compiler-rt/test/fuzzer/swap-cmp.test =================================================================== --- compiler-rt/test/fuzzer/swap-cmp.test +++ compiler-rt/test/fuzzer/swap-cmp.test @@ -1,3 +1,6 @@ +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/SwapCmpTest.cpp -o %t-SwapCmpTest CHECK: BINGO RUN: not %run %t-SwapCmpTest -seed=1 -runs=10000000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/three-bytes.test =================================================================== --- compiler-rt/test/fuzzer/three-bytes.test +++ compiler-rt/test/fuzzer/three-bytes.test @@ -1,4 +1,8 @@ Tests -use_value_profile=2 (alternative VP metric). + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + RUN: %cpp_compiler %S/ThreeBytes.cpp -o %t RUN: %run %t -seed=1 -runs=30000 Index: compiler-rt/test/fuzzer/value-profile-cmp.test =================================================================== --- compiler-rt/test/fuzzer/value-profile-cmp.test +++ compiler-rt/test/fuzzer/value-profile-cmp.test @@ -1,4 +1,8 @@ UNSUPPORTED: ios + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + CHECK: BINGO RUN: %cpp_compiler %S/SimpleCmpTest.cpp -o %t-SimpleCmpTest RUN: not %run %t-SimpleCmpTest -seed=1 -use_cmp=0 -use_value_profile=1 -runs=100000000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/value-profile-cmp2.test =================================================================== --- compiler-rt/test/fuzzer/value-profile-cmp2.test +++ compiler-rt/test/fuzzer/value-profile-cmp2.test @@ -1,6 +1,10 @@ UNSUPPORTED: ios FIXME: Make libFuzzer handle exits without ASan properly on Windows. UNSUPPORTED: windows + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + CHECK: BINGO RUN: %cpp_compiler -fno-sanitize=address %S/SimpleHashTest.cpp -o %t-SimpleHashTest RUN: not %run %t-SimpleHashTest -seed=1 -use_cmp=0 -use_value_profile=1 -runs=100000000 -max_len=64 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/value-profile-cmp3.test =================================================================== --- compiler-rt/test/fuzzer/value-profile-cmp3.test +++ compiler-rt/test/fuzzer/value-profile-cmp3.test @@ -1,4 +1,8 @@ UNSUPPORTED: ios + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + CHECK: BINGO RUN: %cpp_compiler %S/AbsNegAndConstantTest.cpp -o %t-AbsNegAndConstantTest RUN: not %run %t-AbsNegAndConstantTest -seed=1 -use_cmp=0 -use_value_profile=1 -runs=100000000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/value-profile-cmp4.test =================================================================== --- compiler-rt/test/fuzzer/value-profile-cmp4.test +++ compiler-rt/test/fuzzer/value-profile-cmp4.test @@ -1,3 +1,6 @@ +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + CHECK: BINGO RUN: %cpp_compiler %S/AbsNegAndConstant64Test.cpp -o %t-AbsNegAndConstant64Test RUN: not %run %t-AbsNegAndConstant64Test -seed=1 -use_cmp=0 -use_value_profile=1 -runs=100000000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/value-profile-div.test =================================================================== --- compiler-rt/test/fuzzer/value-profile-div.test +++ compiler-rt/test/fuzzer/value-profile-div.test @@ -1,5 +1,9 @@ UNSUPPORTED: ios UNSUPPORTED: aarch64 + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + CHECK: AddressSanitizer: {{FPE|int-divide-by-zero}} RUN: %cpp_compiler %S/DivTest.cpp -fsanitize-coverage=trace-div -o %t-DivTest RUN: not %run %t-DivTest -seed=1 -use_value_profile=1 -runs=10000000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/value-profile-load.test =================================================================== --- compiler-rt/test/fuzzer/value-profile-load.test +++ compiler-rt/test/fuzzer/value-profile-load.test @@ -1,3 +1,6 @@ +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + CHECK: AddressSanitizer: global-buffer-overflow RUN: %cpp_compiler %S/LoadTest.cpp -fsanitize-coverage=trace-gep -o %t-LoadTest RUN: not %run %t-LoadTest -seed=1 -use_cmp=0 -use_value_profile=1 -runs=20000000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/value-profile-mem.test =================================================================== --- compiler-rt/test/fuzzer/value-profile-mem.test +++ compiler-rt/test/fuzzer/value-profile-mem.test @@ -1,6 +1,10 @@ UNSUPPORTED: ios UNSUPPORTED: freebsd + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + CHECK: BINGO -+# Disable trace-cmp so that we test just the memcmp interception +Disable trace-cmp so that we test just the memcmp interception RUN: %cpp_compiler %S/SingleMemcmpTest.cpp -o %t-SingleMemcmpTest -fno-sanitize-coverage=trace-cmp RUN: not %run %t-SingleMemcmpTest -seed=1 -use_cmp=0 -use_value_profile=1 -runs=10000000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/value-profile-set.test =================================================================== --- compiler-rt/test/fuzzer/value-profile-set.test +++ compiler-rt/test/fuzzer/value-profile-set.test @@ -1,4 +1,8 @@ UNSUPPORTED: ios + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + CHECK: BINGO RUN: %cpp_compiler %S/FourIndependentBranchesTest.cpp -o %t-FourIndependentBranchesTest RUN: not %run %t-FourIndependentBranchesTest -seed=1 -use_cmp=0 -use_value_profile=1 -runs=100000000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/value-profile-strcmp.test =================================================================== --- compiler-rt/test/fuzzer/value-profile-strcmp.test +++ compiler-rt/test/fuzzer/value-profile-strcmp.test @@ -1,5 +1,9 @@ UNSUPPORTED: ios UNSUPPORTED: freebsd + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + CHECK: BINGO RUN: %cpp_compiler %S/SingleStrcmpTest.cpp -o %t-SingleStrcmpTest RUN: not %run %t-SingleStrcmpTest -seed=1 -use_cmp=0 -use_value_profile=1 -runs=10000000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/value-profile-strncmp.test =================================================================== --- compiler-rt/test/fuzzer/value-profile-strncmp.test +++ compiler-rt/test/fuzzer/value-profile-strncmp.test @@ -1,4 +1,8 @@ UNSUPPORTED: freebsd, aarch64 + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + CHECK: BINGO RUN: %cpp_compiler %S/SingleStrncmpTest.cpp -o %t-SingleStrncmpTest RUN: not %run %t-SingleStrncmpTest -seed=1 -use_cmp=0 -use_value_profile=1 -runs=100000000 2>&1 | FileCheck %s Index: compiler-rt/test/fuzzer/value-profile-switch.test =================================================================== --- compiler-rt/test/fuzzer/value-profile-switch.test +++ compiler-rt/test/fuzzer/value-profile-switch.test @@ -1,4 +1,8 @@ UNSUPPORTED: ios + +# FIXME: Needs value-profile support for remote fuzzing. +UNSUPPORTED: remote + CHECK: BINGO RUN: %cpp_compiler %S/SwitchTest.cpp -o %t-SwitchTest RUN: %cpp_compiler %S/Switch2Test.cpp -o %t-Switch2Test