Louis Dionne | 150cf7f | 2020-10-16 12:10:49 -0400 | [diff] [blame] | 1 | #!/bin/bash -eu |
| 2 | |
| 3 | # |
| 4 | # This script runs the continuous fuzzing tests on OSS-Fuzz. |
| 5 | # |
| 6 | |
| 7 | if [[ $SANITIZER = *undefined* ]]; then |
| 8 | CXXFLAGS="$CXXFLAGS -fsanitize=unsigned-integer-overflow -fsanitize-trap=unsigned-integer-overflow" |
| 9 | fi |
| 10 | |
| 11 | for f in $(grep -v "#" libcxx/fuzzing/RoutineNames.txt); do |
| 12 | cat > ${f}_fuzzer.cc <<EOF |
| 13 | #include "fuzzing/fuzzing.h" |
| 14 | #include <cassert> |
| 15 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { |
| 16 | int result = fuzzing::$f(data, size); |
| 17 | assert(result == 0); return 0; |
| 18 | } |
| 19 | EOF |
| 20 | $CXX $CXXFLAGS -std=c++11 ${f}_fuzzer.cc ./libcxx/fuzzing/fuzzing.cpp \ |
| 21 | -nostdinc++ -cxx-isystem ./libcxx/include -iquote ./libcxx \ |
| 22 | -o $OUT/$f $LIB_FUZZING_ENGINE |
| 23 | done |