1#!/bin/bash -eu
2
3#
4# This script runs the continuous fuzzing tests on OSS-Fuzz.
5#
6
7if [[ ${SANITIZER} = *undefined* ]]; then
8  CXXFLAGS="${CXXFLAGS} -fsanitize=unsigned-integer-overflow -fsanitize-trap=unsigned-integer-overflow"
9fi
10
11for test in libcxx/test/libcxx/fuzzing/*.pass.cpp; do
12    exe="$(basename ${test})"
13    exe="${exe%.pass.cpp}"
14    ${CXX} ${CXXFLAGS} \
15        -std=c++14 \
16        -DLIBCPP_OSS_FUZZ \
17        -nostdinc++ -cxx-isystem libcxx/include \
18        -o "${OUT}/${exe}" \
19        ${test} \
20        ${LIB_FUZZING_ENGINE}
21done
22