Add -fno-sanitize=shift to the sanitize=undefined test, and temporarily disable

the debug test.
This commit is contained in:
Philip.Hazel 2015-05-28 16:48:42 +00:00
parent 9ce0207f5c
commit 78b057023a
1 changed files with 19 additions and 17 deletions

View File

@ -27,7 +27,8 @@
useasan=1
useusan=1
usedebug=1
# Temporarily disabled.
usedebug=0
usejit=1
usemain=1
usetmp=1
@ -200,19 +201,18 @@ testtotal=`expr 20 \* $usemain + \
\( 3 + 2 \* $usejit \) \* $usevalgrind`
testcount=0
# This set of tests builds PCRE2 and runs the tests with a variety of configure
# options, in the current (source) directory. The empty configuration builds
# with all the default settings. As well as testing that these options work, we
# use --disable-shared or --disable-static after the default test (which builds
# both) to save a bit of time by building only one version of the library for
# the subsequent tests.
valgrind=
cvalgrind=
withvalgrind=
srcdir=.
export srcdir
if [ $usejit -ne 0 ]; then
enable_jit=--enable-jit
else
enable_jit=
fi
# If gcc is in use, run a maximally configured test with -O2, because that can
# throw up warnings that are not detected with -O0. Then run a second test with
# -fsanitize=address, which also may throw up new warnings as well as checking
@ -220,13 +220,8 @@ export srcdir
# frames by a lot, so run this test with --disable-stack-for-recursion, as
# otherwise RunTest may fail on test 2. Finally, run another test using
# -fsanitize=undefined -std-gnu99 to check for runtime actions that are not
# well defined.
if [ $usejit -ne 0 ]; then
enable_jit=--enable-jit
else
enable_jit=
fi
# well defined. However, we also use -fno-sanitize=shift to avoid warnings for
# shifts of negative numbers, which occur in src/pcre2_jit_compile.c.
if [ $ISGCC -ne 0 -a $usemain -ne 0 ]; then
echo "---------- Maximally configured test with -O2 ----------"
@ -243,8 +238,8 @@ if [ $ISGCC -ne 0 -a $usemain -ne 0 ]; then
runtest
fi
if [ $useusan -ne 0 ]; then
echo "------- Maximally configured test with -fsanitize=undefined -std=gnu99 -------"
CFLAGS="$OFLAGS $SAVECFLAGS -fsanitize=undefined -std=gnu99"
echo "------- Maximally configured test with -fsanitize=undefined -fno-sanitize=shift -std=gnu99 -------"
CFLAGS="$OFLAGS $SAVECFLAGS -fsanitize=undefined -fno-sanitize=shift -std=gnu99"
echo "CFLAGS=$CFLAGS"
opts="--disable-shared $enable_jit --disable-stack-for-recursion --enable-pcre2-16 --enable-pcre2-32"
runtest
@ -252,6 +247,13 @@ if [ $ISGCC -ne 0 -a $usemain -ne 0 ]; then
CFLAGS="$OFLAGS $SAVECFLAGS"
fi
# This set of tests builds PCRE2 and runs the tests with a variety of configure
# options, in the current (source) directory. The empty configuration builds
# with all the default settings. As well as testing that these options work, we
# use --disable-shared or --disable-static except for the default test (which
# builds both) to save a bit of time by building only one version of the
# library for the subsequent tests.
echo "---------- CFLAGS for the remaining tests ----------"
echo "CFLAGS=$CFLAGS"