Index: cmake/config-ix.cmake =================================================================== --- cmake/config-ix.cmake +++ cmake/config-ix.cmake @@ -196,7 +196,7 @@ set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${MIPS32} ${MIPS64} ${PPC64} ${S390X}) set(ALL_DFSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64}) -set(ALL_FUZZER_SUPPORTED_ARCH x86_64) +set(ALL_FUZZER_SUPPORTED_ARCH ${X86_64} ${ARM64}) if(APPLE) set(ALL_LSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${MIPS64} ${ARM64}) @@ -426,7 +426,7 @@ SANITIZER_COMMON_SUPPORTED_ARCH) list_intersect(FUZZER_SUPPORTED_ARCH ALL_FUZZER_SUPPORTED_ARCH - ALL_SANITIZER_COMMON_SUPPORTED_ARCH) + SANITIZER_COMMON_SUPPORTED_ARCH) list_intersect(XRAY_SUPPORTED_ARCH ALL_XRAY_SUPPORTED_ARCH SANITIZER_COMMON_SUPPORTED_ARCH) Index: lib/fuzzer/CMakeLists.txt =================================================================== --- lib/fuzzer/CMakeLists.txt +++ lib/fuzzer/CMakeLists.txt @@ -50,9 +50,7 @@ list(APPEND LIBFUZZER_CFLAGS -Dthread_local=__thread) endif() -if(APPLE) - set(FUZZER_SUPPORTED_OS osx) -endif() +set(FUZZER_SUPPORTED_OS ${SANITIZER_COMMON_SUPPORTED_OS}) add_compiler_rt_object_libraries(RTfuzzer OS ${FUZZER_SUPPORTED_OS} Index: lib/fuzzer/tests/CMakeLists.txt =================================================================== --- lib/fuzzer/tests/CMakeLists.txt +++ lib/fuzzer/tests/CMakeLists.txt @@ -6,6 +6,10 @@ -Werror -O2) +if (APPLE) + set(FUZZER_SUPPORTED_OS osx) +endif() + add_custom_target(FuzzerUnitTests) set_target_properties(FuzzerUnitTests PROPERTIES FOLDER "Compiler-RT Tests") @@ -22,35 +26,36 @@ list(APPEND LIBFUZZER_UNITTEST_CFLAGS -nostdinc++ -D_LIBCPP_ABI_VERSION=Fuzzer) endif() -foreach(arch ${FUZZER_SUPPORTED_ARCH}) - set(LIBFUZZER_TEST_RUNTIME RTFuzzerTest.${arch}) - if(APPLE) - set(LIBFUZZER_TEST_RUNTIME_OBJECTS - $) - else() - set(LIBFUZZER_TEST_RUNTIME_OBJECTS - $) - endif() - add_library(${LIBFUZZER_TEST_RUNTIME} STATIC - ${LIBFUZZER_TEST_RUNTIME_OBJECTS}) - set_target_properties(${LIBFUZZER_TEST_RUNTIME} PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - FOLDER "Compiler-RT Runtime tests") - - if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND COMPILER_RT_LIBCXX_PATH) - set(LIBFUZZER_TEST_RUNTIME_DEPS libcxx_fuzzer_${arch}-build) - set(LIBFUZZER_TEST_RUNTIME_CFLAGS -isystem ${COMPILER_RT_LIBCXX_PATH}/include) - set(LIBFUZZER_TEST_RUNTIME_LINK_FLAGS ${LIBCXX_${arch}_PREFIX}/lib/libc++.a) - endif() - - set(FuzzerTestObjects) - generate_compiler_rt_tests(FuzzerTestObjects - FuzzerUnitTests "Fuzzer-${arch}-Test" ${arch} - SOURCES FuzzerUnittest.cpp ${COMPILER_RT_GTEST_SOURCE} - RUNTIME ${LIBFUZZER_TEST_RUNTIME} - DEPS gtest ${LIBFUZZER_TEST_RUNTIME_DEPS} - CFLAGS ${LIBFUZZER_UNITTEST_CFLAGS} ${LIBFUZZER_TEST_RUNTIME_CFLAGS} - LINK_FLAGS ${LIBFUZZER_UNITTEST_LINK_FLAGS} ${LIBFUZZER_TEST_RUNTIME_LINK_FLAGS}) - set_target_properties(FuzzerUnitTests PROPERTIES - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) -endforeach() +# libFuzzer unit tests are only run on the host machine. +set(arch "x86_64") + +set(LIBFUZZER_TEST_RUNTIME RTFuzzerTest.${arch}) +if(APPLE) + set(LIBFUZZER_TEST_RUNTIME_OBJECTS + $) +else() + set(LIBFUZZER_TEST_RUNTIME_OBJECTS + $) +endif() +add_library(${LIBFUZZER_TEST_RUNTIME} STATIC + ${LIBFUZZER_TEST_RUNTIME_OBJECTS}) +set_target_properties(${LIBFUZZER_TEST_RUNTIME} PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + FOLDER "Compiler-RT Runtime tests") + +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND COMPILER_RT_LIBCXX_PATH) + set(LIBFUZZER_TEST_RUNTIME_DEPS libcxx_fuzzer_${arch}-build) + set(LIBFUZZER_TEST_RUNTIME_CFLAGS -isystem ${COMPILER_RT_LIBCXX_PATH}/include) + set(LIBFUZZER_TEST_RUNTIME_LINK_FLAGS ${LIBCXX_${arch}_PREFIX}/lib/libc++.a) +endif() + +set(FuzzerTestObjects) +generate_compiler_rt_tests(FuzzerTestObjects + FuzzerUnitTests "Fuzzer-${arch}-Test" ${arch} + SOURCES FuzzerUnittest.cpp ${COMPILER_RT_GTEST_SOURCE} + RUNTIME ${LIBFUZZER_TEST_RUNTIME} + DEPS gtest ${LIBFUZZER_TEST_RUNTIME_DEPS} + CFLAGS ${LIBFUZZER_UNITTEST_CFLAGS} ${LIBFUZZER_TEST_RUNTIME_CFLAGS} + LINK_FLAGS ${LIBFUZZER_UNITTEST_LINK_FLAGS} ${LIBFUZZER_TEST_RUNTIME_LINK_FLAGS}) +set_target_properties(FuzzerUnitTests PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) Index: test/fuzzer/CMakeLists.txt =================================================================== --- test/fuzzer/CMakeLists.txt +++ test/fuzzer/CMakeLists.txt @@ -1,5 +1,4 @@ set(LIBFUZZER_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) -list(REMOVE_ITEM LIBFUZZER_TEST_DEPS SanitizerLintCheck) if (NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND LIBFUZZER_TEST_DEPS fuzzer asan ubsan) endif() @@ -11,6 +10,8 @@ set(EXCLUDE_FROM_ALL ON) add_custom_target(check-fuzzer) +set(LIBFUZZER_TEST_IOS "0") +pythonize_bool(LIBFUZZER_TEST_IOS) if(COMPILER_RT_INCLUDE_TESTS) # libFuzzer unit tests. @@ -50,14 +51,16 @@ ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg ) - add_lit_testsuite(check-fuzzer-${stdlib_name} "Running Fuzzer ${stdlib} tests" - ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME} + add_lit_testsuite(check-fuzzer-${stdlib_name}-${arch} + "Running Fuzzer ${stdlib} tests" + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/ DEPENDS ${LIBFUZZER_TEST_DEPS}) if(TEST_DEPS) - add_dependencies(check-fuzzer-${stdlib_name} ${TEST_DEPS}) + add_dependencies(check-fuzzer-${stdlib_name}-${arch} ${TEST_DEPS}) endif() - set_target_properties(check-fuzzer-${stdlib_name} PROPERTIES FOLDER "Compiler-RT Tests") - add_dependencies(check-fuzzer check-fuzzer-${stdlib_name}) + set_target_properties(check-fuzzer-${stdlib_name}-${arch} + PROPERTIES FOLDER "Compiler-RT Tests") + add_dependencies(check-fuzzer check-fuzzer-${stdlib_name}-${arch}) endforeach() endmacro() @@ -70,3 +73,27 @@ test_fuzzer("static-libc++" DEPS cxx_static) endif() endif() + +if (APPLE) + set(EXCLUDE_FROM_ALL ON) + + foreach(arch ${DARWIN_ios_ARCHS}) + set(LIBFUZZER_TEST_IOS "1") + pythonize_bool(LIBFUZZER_TEST_IOS) + set(LIBFUZZER_TEST_TARGET_ARCH ${arch}) + set(LIBFUZZER_TEST_TARGET_CFLAGS "-arch ${arch} -isysroot ${DARWIN_ios_SYSROOT} ${COMPILER_RT_TEST_COMPILER_CFLAGS}") + set(LIBFUZZER_TEST_CONFIG_SUFFIX "-${arch}-ios") + string(TOUPPER ${arch} ARCH_UPPER_CASE) + set(CONFIG_NAME "IOS${ARCH_UPPER_CASE}Config") + configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg + ) + add_lit_testsuite(check-fuzzer-ios-${arch} "libFuzzer iOS ${arch} tests" + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/ + DEPENDS ${LIBFUZZER_TEST_DEPS}) + + endforeach() + + set(EXCLUDE_FROM_ALL OFF) +endif() Index: test/fuzzer/afl-driver-extra-stats.test =================================================================== --- test/fuzzer/afl-driver-extra-stats.test +++ test/fuzzer/afl-driver-extra-stats.test @@ -1,3 +1,4 @@ +XFAIL: ios RUN: %no_fuzzer_cpp_compiler -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters,trace-pc-guard %S/AFLDriverTest.cpp %libfuzzer_src/afl/afl_driver.cpp -o %t-AFLDriverTest ; Test that not specifying an extra stats file isn't broken. Index: test/fuzzer/afl-driver-stderr.test =================================================================== --- test/fuzzer/afl-driver-stderr.test +++ test/fuzzer/afl-driver-stderr.test @@ -1,3 +1,4 @@ +XFAIL: ios UNSUPPORTED: freebsd RUN: %no_fuzzer_cpp_compiler -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters,trace-pc-guard %S/AFLDriverTest.cpp %libfuzzer_src/afl/afl_driver.cpp -o %t-AFLDriverTest Index: test/fuzzer/counters.test =================================================================== --- test/fuzzer/counters.test +++ test/fuzzer/counters.test @@ -1,3 +1,4 @@ +XFAIL: ios 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: test/fuzzer/dso.test =================================================================== --- test/fuzzer/dso.test +++ test/fuzzer/dso.test @@ -1,6 +1,6 @@ -RUN: %cpp_compiler %S/DSO1.cpp -fPIC -shared -o %t-DSO1.so -RUN: %cpp_compiler %S/DSO2.cpp -fPIC -shared -o %t-DSO2.so -RUN: %cpp_compiler %S/DSOTestMain.cpp %S/DSOTestExtra.cpp -L. %t-DSO1.so %t-DSO2.so -o %t-DSOTest +RUN: %cpp_compiler %S/DSO1.cpp -fPIC -shared -o %dynamiclib1 %ld_flags_rpath_so1 +RUN: %cpp_compiler %S/DSO2.cpp -fPIC -shared -o %dynamiclib2 %ld_flags_rpath_so2 +RUN: %cpp_compiler %S/DSOTestMain.cpp %S/DSOTestExtra.cpp %ld_flags_rpath_exe1 %ld_flags_rpath_exe2 -o %t-DSOTest RUN: not %run %t-DSOTest 2>&1 | FileCheck %s --check-prefix=DSO DSO: INFO: Loaded 3 modules Index: test/fuzzer/dump_coverage.test =================================================================== --- test/fuzzer/dump_coverage.test +++ test/fuzzer/dump_coverage.test @@ -1,7 +1,7 @@ UNSUPPORTED: freebsd -RUN: %cpp_compiler -fsanitize-coverage=0 -fsanitize-coverage=trace-pc-guard %S/DSO1.cpp -fPIC -shared -o %t-DSO1.so -RUN: %cpp_compiler -fsanitize-coverage=0 -fsanitize-coverage=trace-pc-guard %S/DSO2.cpp -fPIC -shared -o %t-DSO2.so -RUN: %cpp_compiler -fsanitize-coverage=0 -fsanitize-coverage=trace-pc-guard %S/DSOTestMain.cpp %S/DSOTestExtra.cpp -L. %t-DSO1.so %t-DSO2.so -o %t-DSOTest +RUN: %cpp_compiler -fsanitize-coverage=0 -fsanitize-coverage=trace-pc-guard %S/DSO1.cpp -fPIC -shared -o %dynamiclib1 %ld_flags_rpath_so1 +RUN: %cpp_compiler -fsanitize-coverage=0 -fsanitize-coverage=trace-pc-guard %S/DSO2.cpp -fPIC -shared -o %dynamiclib2 %ld_flags_rpath_so2 +RUN: %cpp_compiler -fsanitize-coverage=0 -fsanitize-coverage=trace-pc-guard %S/DSOTestMain.cpp %S/DSOTestExtra.cpp %ld_flags_rpath_exe1 %ld_flags_rpath_exe2 -o %t-DSOTest RUN: %cpp_compiler -fsanitize-coverage=0 -fsanitize-coverage=trace-pc-guard %S/NullDerefTest.cpp -o %t-NullDerefTest @@ -15,7 +15,7 @@ SANCOV: LLVMFuzzerTestOneInput DSO: SanitizerCoverage: {{.*}}DSOTest.{{.*}}.sancov: {{.*}} PCs written -DSO-DAG: SanitizerCoverage: {{.*}}DSO1.{{.*}}.sancov: {{.*}} PCs written -DSO-DAG: SanitizerCoverage: {{.*}}DSO2.{{.*}}.sancov: {{.*}} PCs written +DSO-DAG: SanitizerCoverage: {{.*}}1.{{.*}}.sancov: {{.*}} PCs written +DSO-DAG: SanitizerCoverage: {{.*}}2.{{.*}}.sancov: {{.*}} PCs written NOCOV-NOT: SanitizerCoverage: {{.*}} PCs written Index: test/fuzzer/fuzzer-fdmask.test =================================================================== --- test/fuzzer/fuzzer-fdmask.test +++ test/fuzzer/fuzzer-fdmask.test @@ -6,23 +6,23 @@ RUN: %run %t-SpamyTest -runs=1 -close_fd_mask=2 2>&1 | FileCheck %s --check-prefix=FD_MASK_2 RUN: %run %t-SpamyTest -runs=1 -close_fd_mask=3 2>&1 | FileCheck %s --check-prefix=FD_MASK_3 -FD_MASK_0: PRINTF_STDOUT -FD_MASK_0: PRINTF_STDERR -FD_MASK_0: STREAM_COUT -FD_MASK_0: STREAM_CERR -FD_MASK_0: INITED +FD_MASK_0-DAG: PRINTF_STDOUT +FD_MASK_0-DAG: PRINTF_STDERR +FD_MASK_0-DAG: STREAM_COUT +FD_MASK_0-DAG: STREAM_CERR +FD_MASK_0-DAG: INITED FD_MASK_1-NOT: PRINTF_STDOUT -FD_MASK_1: PRINTF_STDERR +FD_MASK_1-DAG: PRINTF_STDERR FD_MASK_1-NOT: STREAM_COUT -FD_MASK_1: STREAM_CERR -FD_MASK_1: INITED +FD_MASK_1-DAG: STREAM_CERR +FD_MASK_1-DAG: INITED -FD_MASK_2: PRINTF_STDOUT +FD_MASK_2-DAG: PRINTF_STDOUT +FD_MASK_2-DAG: STREAM_COUT +FD_MASK_2-DAG: INITED FD_MASK_2-NOT: PRINTF_STDERR -FD_MASK_2: STREAM_COUT -FD_MASK_2-NOTE: STREAM_CERR -FD_MASK_2: INITED +FD_MASK_2-NOT: STREAM_CERR FD_MASK_3-NOT: PRINTF_STDOUT FD_MASK_3-NOT: PRINTF_STDERR Index: test/fuzzer/fuzzer-printcovpcs.test =================================================================== --- test/fuzzer/fuzzer-printcovpcs.test +++ test/fuzzer/fuzzer-printcovpcs.test @@ -1,3 +1,4 @@ +XFAIL: ios 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 Index: test/fuzzer/lit.cfg =================================================================== --- test/fuzzer/lit.cfg +++ test/fuzzer/lit.cfg @@ -2,7 +2,7 @@ import sys import os -config.name = "LLVMFuzzer" +config.name = "libFuzzer" + config.name_suffix config.test_format = lit.formats.ShTest(True) config.suffixes = ['.test'] config.test_source_root = os.path.dirname(__file__) @@ -47,25 +47,42 @@ config.substitutions.append(('%build_dir', config.cmake_binary_dir)) libfuzzer_src_root = os.path.join(config.compiler_rt_src_root, "lib", "fuzzer") +include_root = os.path.join(config.compiler_rt_src_root, "include") config.substitutions.append(('%libfuzzer_src', libfuzzer_src_root)) def generate_compiler_cmd(is_cpp=True, fuzzer_enabled=True): - compiler_cmd = config.c_compiler + compiler_cmd = config.clang + extra_cmd = config.target_cflags if config.clang and config.stdlib == 'libc++': - link_cmd = '-stdlib=libc++ -Wl,-rpath=%s' % config.llvm_library_dir + lib_cmd = '-stdlib=libc++ -Wl,-rpath=%s' % config.llvm_library_dir elif config.clang and config.stdlib == 'static-libc++': - link_cmd = '-stdlib=libc++ -lc++abi -static-libstdc++ -Wl,-rpath=%s' % config.llvm_library_dir + lib_cmd = '-stdlib=libc++ -lc++abi -static-libstdc++ -Wl,-rpath=%s' % ( + config.llvm_library_dir) + elif any(x in config.target_triple for x in ('darwin', 'freebsd')): + lib_cmd = '-lc++' else: - link_cmd = '-lc++' if any(x in config.target_triple for x in ('darwin', 'freebsd')) else '-lstdc++' + lib_cmd = '-lstdc++' + std_cmd = '--driver-mode=g++ -std=c++11' if is_cpp else '' - sanitizers = ['address'] + sanitizers_cmd = ['address'] if fuzzer_enabled: - sanitizers.append('fuzzer') - sanitizers_cmd = ('-fsanitize=%s' % ','.join(sanitizers)) - isysroot_cmd = config.osx_sysroot_flag if config.osx_sysroot_flag else '' - include_cmd = '-I%s' % libfuzzer_src_root - return '%s %s %s -O2 -gline-tables-only %s %s %s' % ( - compiler_cmd, std_cmd, link_cmd, isysroot_cmd, sanitizers_cmd, include_cmd) + sanitizers_cmd.append('fuzzer') + sanitizers_cmd = ('-fsanitize=%s' % ','.join(sanitizers_cmd)) + if config.osx_sysroot_flag and not 'isysroot' in extra_cmd: + isysroot_cmd = config.osx_sysroot_flag + else: + isysroot_cmd = '' + return " ".join([ + compiler_cmd, + std_cmd, + lib_cmd, + "-O2 -gline-tables-only", + isysroot_cmd, + sanitizers_cmd, + "-I%s" % libfuzzer_src_root, + "-I%s" % include_root, + extra_cmd + ]) config.substitutions.append(('%cpp_compiler', generate_compiler_cmd(is_cpp=True, fuzzer_enabled=True) @@ -82,3 +99,9 @@ config.substitutions.append(('%no_fuzzer_c_compiler', generate_compiler_cmd(is_cpp=False, fuzzer_enabled=False) )) + +if config.host_os == 'Darwin': + if config.target_arch in ["x86_64", "x86_64h"]: + config.parallelism_group = "darwin-64bit-sanitizer" + elif config.ios and not config.iossim: + config.parallelism_group = "darwin-ios-device-sanitizer" Index: test/fuzzer/lit.site.cfg.in =================================================================== --- test/fuzzer/lit.site.cfg.in +++ test/fuzzer/lit.site.cfg.in @@ -6,6 +6,9 @@ config.target_flags = "@LIBFUZZER_TEST_FLAGS@" config.c_compiler = "@LIBFUZZER_TEST_COMPILER@" config.stdlib = "@LIBFUZZER_TEST_STDLIB@" +config.ios = @LIBFUZZER_TEST_IOS_PYBOOL@ +config.target_cflags = "@LIBFUZZER_TEST_TARGET_CFLAGS@" +config.name_suffix = "@LIBFUZZER_TEST_CONFIG_SUFFIX@" config.osx_sysroot_flag = "@OSX_SYSROOT_FLAG@" config.cmake_binary_dir = "@CMAKE_BINARY_DIR@" Index: test/fuzzer/merge-posix.test =================================================================== --- test/fuzzer/merge-posix.test +++ test/fuzzer/merge-posix.test @@ -1,3 +1,4 @@ +XFAIL: ios RUN: %cpp_compiler %S/FullCoverageSetTest.cpp -o %t-FullCoverageSetTest RUN: rm -rf %tmp/T1 %tmp/T2 Index: test/fuzzer/merge-sigusr.test =================================================================== --- test/fuzzer/merge-sigusr.test +++ test/fuzzer/merge-sigusr.test @@ -1,4 +1,5 @@ # Check that libFuzzer honors SIGUSR1/SIGUSR2 +XFAIL: ios RUN: rm -rf %t RUN: mkdir -p %t RUN: %cpp_compiler %S/SleepOneSecondTest.cpp -o %t/LFSIGUSR Index: test/fuzzer/merge.test =================================================================== --- test/fuzzer/merge.test +++ test/fuzzer/merge.test @@ -1,3 +1,4 @@ +XFAIL: ios CHECK: BINGO RUN: %cpp_compiler %S/FullCoverageSetTest.cpp -o %t-FullCoverageSetTest Index: test/fuzzer/minimize_crash.test =================================================================== --- test/fuzzer/minimize_crash.test +++ test/fuzzer/minimize_crash.test @@ -1,16 +1,17 @@ RUN: %cpp_compiler %S/NullDerefTest.cpp -o %t-NullDerefTest RUN: %cpp_compiler %S/SingleByteInputTest.cpp -o %t-SingleByteInputTest +RUN: mkdir -p %t.dir -RUN: echo 'Hi!rv349f34t3gg' > not_minimal_crash -RUN: %run %t-NullDerefTest -minimize_crash=1 not_minimal_crash -max_total_time=2 2>&1 | FileCheck %s -CHECK: CRASH_MIN: failed to minimize beyond ./minimized-from-{{.*}} (3 bytes), exiting -RUN: %run %t-NullDerefTest -minimize_crash=1 not_minimal_crash -max_total_time=2 -exact_artifact_path=exact_minimized_path 2>&1 | FileCheck %s --check-prefix=CHECK_EXACT -CHECK_EXACT: CRASH_MIN: failed to minimize beyond exact_minimized_path (3 bytes), exiting -RUN: rm not_minimal_crash minimized-from-* exact_minimized_path +RUN: echo 'Hi!rv349f34t3gg' > %t.dir/not_minimal_crash +RUN: %run %t-NullDerefTest -minimize_crash=1 %t.dir/not_minimal_crash -max_total_time=2 2>&1 | FileCheck %s +CHECK: CRASH_MIN: failed to minimize beyond {{.*}} (3 bytes), exiting +RUN: %run %t-NullDerefTest -minimize_crash=1 %t.dir/not_minimal_crash -max_total_time=2 -exact_artifact_path=%t.exact_minimized_path 2>&1 | FileCheck %s --check-prefix=CHECK_EXACT +CHECK_EXACT: CRASH_MIN: failed to minimize beyond {{.*}} (3 bytes), exiting +RUN: rm %t.dir/not_minimal_crash %t.exact_minimized_path -RUN: echo -n 'abcd*xyz' > not_minimal_crash -RUN: %run %t-SingleByteInputTest -minimize_crash=1 not_minimal_crash -exact_artifact_path=exact_minimized_path 2>&1 | FileCheck %s --check-prefix=MIN1 -MIN1: Test unit written to exact_minimized_path -MIN1: Test unit written to exact_minimized_path +RUN: echo -n 'abcd*xyz' > %t.dir/not_minimal_crash +RUN: %run %t-SingleByteInputTest -minimize_crash=1 %t.dir/not_minimal_crash -exact_artifact_path=%t.exact_minimized_path 2>&1 | FileCheck %s --check-prefix=MIN1 +MIN1: Test unit written to {{.*}} +MIN1: Test unit written to {{.*}} MIN1: INFO: The input is small enough, exiting -MIN1: CRASH_MIN: failed to minimize beyond exact_minimized_path (1 bytes), exiting +MIN1: CRASH_MIN: failed to minimize beyond {{.*}} (1 bytes), exiting Index: test/fuzzer/value-profile-div.test =================================================================== --- test/fuzzer/value-profile-div.test +++ test/fuzzer/value-profile-div.test @@ -1,3 +1,4 @@ +XFAIL: ios 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