2016-09-23 15:32:14 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# cryptest.sh - written and placed in public domain by Jeffrey Walton and Uri Blumenthal.
|
|
|
|
|
|
|
|
# This is a test script that can be used on some Linux/Unix/Apple machines to automate building the
|
|
|
|
# library and running the self test with various combinations of flags, options, and conditions.
|
|
|
|
# For more details, see http://cryptopp.com/wiki/cryptest.sh.
|
|
|
|
|
|
|
|
# To run the script, simply perform the following:
|
|
|
|
# ./cryptest.sh
|
|
|
|
|
|
|
|
# If you want to test a particular compiler, like clang++ or icpc, issue:
|
|
|
|
# CXX=clang++ ./cryptest.sh
|
|
|
|
# CXX=/opt/intel/bin/icpc ./cryptest.sh
|
|
|
|
# CXX=/opt/solstudio12.2/bin/CC ./cryptest.sh
|
|
|
|
|
|
|
|
# The script ignores CXXFLAGS. You can add CXXFLAGS, like -mcpu or -mtune, through USER_CXXFLAGS:
|
|
|
|
# USER_CXXFLAGS=-Wall ./cryptest.sh
|
|
|
|
# USER_CXXFLAGS="-Wall -Wextra" ./cryptest.sh
|
|
|
|
|
|
|
|
# The fastest results (in running time) will most likely omit Valgrind and Benchmarks because
|
|
|
|
# significantly increase execution time:
|
|
|
|
# HAVE_VALGRIND=0 WANT_BENCHMARKS=0 ./cryptest.sh
|
|
|
|
|
|
|
|
# Using 'fast' is shorthand for HAVE_VALGRIND=0 WANT_BENCHMARKS=0:
|
|
|
|
# ./cryptest.sh fast
|
|
|
|
|
2016-12-27 17:34:57 +00:00
|
|
|
# You can reduce CPU load with the following. It will use half the number of CPU cores
|
2016-09-23 15:32:14 +00:00
|
|
|
# rather than all of them. Its useful at places like the GCC Compile Farm, where being nice is policy.
|
|
|
|
# ./cryptest.sh nice
|
|
|
|
|
2017-10-30 12:19:50 +00:00
|
|
|
# Keep the noise down
|
|
|
|
# shellcheck disable=SC2181
|
2020-05-09 21:55:44 +00:00
|
|
|
# shellcheck disable=SC2016
|
|
|
|
# shellcheck disable=SC2034
|
2017-10-30 12:19:50 +00:00
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
############################################
|
|
|
|
# Set to suite your taste
|
|
|
|
|
|
|
|
if [[ (-z "$TEST_RESULTS") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_RESULTS=cryptest-result.txt
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
if [[ (-z "$BENCHMARK_RESULTS") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
BENCHMARK_RESULTS=cryptest-bench.txt
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
if [[ (-z "$WARN_RESULTS") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
WARN_RESULTS=cryptest-warn.txt
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
if [[ (-z "$INSTALL_RESULTS") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
INSTALL_RESULTS=cryptest-install.txt
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2020-05-10 03:15:04 +00:00
|
|
|
if [[ -z "$test_prog" ]]; then
|
|
|
|
test_prog="TestPrograms/test_cxx.cxx"
|
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
# Remove previous test results
|
2020-05-10 03:15:04 +00:00
|
|
|
rm -f "$TEST_RESULTS" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
touch "$TEST_RESULTS"
|
|
|
|
|
2020-05-10 03:15:04 +00:00
|
|
|
rm -f "$BENCHMARK_RESULTS" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
touch "$BENCHMARK_RESULTS"
|
|
|
|
|
2020-05-10 03:15:04 +00:00
|
|
|
rm -f "$WARN_RESULTS" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
touch "$WARN_RESULTS"
|
|
|
|
|
2020-05-10 03:15:04 +00:00
|
|
|
rm -f "$INSTALL_RESULTS" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
touch "$INSTALL_RESULTS"
|
|
|
|
|
|
|
|
# Avoid CRYPTOPP_DATA_DIR in this shell (it is tested below)
|
|
|
|
unset CRYPTOPP_DATA_DIR
|
|
|
|
|
|
|
|
# Avoid Malloc and Scribble guards on OS X (they are tested below)
|
|
|
|
unset MallocScribble MallocPreScribble MallocGuardEdges
|
|
|
|
|
2017-11-13 21:57:03 +00:00
|
|
|
# List of tests performed
|
|
|
|
TEST_LIST=()
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
############################################
|
|
|
|
# Setup tools and platforms
|
|
|
|
|
2021-03-08 22:23:11 +00:00
|
|
|
GREP="grep"
|
|
|
|
SED="sed"
|
|
|
|
AWK="awk"
|
|
|
|
MAKE="make"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2021-03-08 22:23:11 +00:00
|
|
|
DISASS="objdump"
|
2016-09-23 15:32:14 +00:00
|
|
|
DISASSARGS=("--disassemble")
|
|
|
|
|
2017-08-29 12:57:04 +00:00
|
|
|
# Fixup, Solaris and friends
|
|
|
|
if [[ (-d /usr/xpg4/bin) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
SED=/usr/xpg4/bin/sed
|
|
|
|
AWK=/usr/xpg4/bin/awk
|
|
|
|
GREP=/usr/xpg4/bin/grep
|
2017-08-29 12:57:04 +00:00
|
|
|
elif [[ (-d /usr/bin/posix) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
SED=/usr/bin/posix/sed
|
|
|
|
AWK=/usr/bin/posix/awk
|
|
|
|
GREP=/usr/bin/posix/grep
|
2017-08-29 12:57:04 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Fixup, Solaris and BSDs
|
2017-10-16 10:39:50 +00:00
|
|
|
if [[ $(command -v gmake 2>/dev/null) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
MAKE="gmake"
|
2017-10-16 10:39:50 +00:00
|
|
|
else
|
2020-05-10 03:16:29 +00:00
|
|
|
MAKE="make"
|
2017-08-29 12:57:04 +00:00
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
THIS_SYSTEM=$(uname -s 2>&1)
|
2020-05-10 03:28:50 +00:00
|
|
|
IS_AIX=$("$GREP" -i -c aix <<< "$THIS_SYSTEM")
|
|
|
|
IS_DARWIN=$("$GREP" -i -c darwin <<< "$THIS_SYSTEM")
|
|
|
|
IS_HURD=$("$GREP" -i -c gnu <<< "$THIS_SYSTEM")
|
|
|
|
IS_LINUX=$("$GREP" -i -c linux <<< "$THIS_SYSTEM")
|
|
|
|
IS_CYGWIN=$("$GREP" -i -c cygwin <<< "$THIS_SYSTEM")
|
|
|
|
IS_MINGW=$("$GREP" -i -c mingw <<< "$THIS_SYSTEM")
|
|
|
|
IS_OPENBSD=$("$GREP" -i -c openbsd <<< "$THIS_SYSTEM")
|
|
|
|
IS_DRAGONFLY=$("$GREP" -i -c dragonfly <<< "$THIS_SYSTEM")
|
|
|
|
IS_FREEBSD=$("$GREP" -i -c freebsd <<< "$THIS_SYSTEM")
|
|
|
|
IS_NETBSD=$("$GREP" -i -c netbsd <<< "$THIS_SYSTEM")
|
|
|
|
IS_SOLARIS=$("$GREP" -i -c sunos <<< "$THIS_SYSTEM")
|
|
|
|
IS_BSD=$("$GREP" -i -c bsd <<< "$THIS_SYSTEM")
|
|
|
|
|
|
|
|
THIS_RELEASE=$(lsb_release -a 2>&1)
|
|
|
|
IS_DEBIAN=$("$GREP" -i -c debian <<< "$THIS_RELEASE")
|
|
|
|
IS_FEDORA=$("$GREP" -i -c fedora <<< "$THIS_RELEASE")
|
|
|
|
IS_UBUNTU=$("$GREP" -i -c ubuntu <<< "$THIS_RELEASE")
|
|
|
|
IS_SUSE=$("$GREP" -i -c opensuse <<< "$THIS_RELEASE")
|
2017-05-25 04:04:45 +00:00
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
THIS_MACHINE=$(uname -m 2>&1)
|
2020-05-10 03:28:50 +00:00
|
|
|
IS_X86=$("$GREP" -i -c -E "(i386|i486|i686|i686)" <<< "$THIS_MACHINE")
|
|
|
|
IS_X64=$("$GREP" -i -c -E "(amd64|x86_64)" <<< "$THIS_MACHINE")
|
|
|
|
IS_PPC32=$("$GREP" -i -c -E "(Power|PPC)" <<< "$THIS_MACHINE")
|
|
|
|
IS_PPC64=$("$GREP" -i -c -E "(Power64|PPC64)" <<< "$THIS_MACHINE")
|
|
|
|
IS_ARM32=$("$GREP" -i -c -E "(arm|aarch32)" <<< "$THIS_MACHINE")
|
|
|
|
IS_ARM64=$("$GREP" -i -c -E "(arm64|aarch64)" <<< "$THIS_MACHINE")
|
|
|
|
IS_S390=$("$GREP" -i -c "s390" <<< "$THIS_MACHINE")
|
|
|
|
IS_SPARC=$("$GREP" -i -c "sparc" <<< "$THIS_MACHINE")
|
2016-09-23 15:32:14 +00:00
|
|
|
IS_X32=0
|
|
|
|
|
2021-03-09 02:13:43 +00:00
|
|
|
# Fixup
|
|
|
|
if [[ "$IS_AIX" -ne 0 ]]; then
|
|
|
|
THIS_MACHINE="$(prtconf | "$GREP" -i "Processor Type" | head -n 1 | cut -f 2 -d ':')"
|
|
|
|
IS_PPC32=$("$GREP" -i -c -E "(Power|PPC)" <<< "$THIS_MACHINE")
|
|
|
|
IS_PPC64=$("$GREP" -i -c -E "(Power64|PPC64)" <<< "$THIS_MACHINE")
|
|
|
|
fi
|
|
|
|
|
2020-05-10 03:28:50 +00:00
|
|
|
# Fixup
|
|
|
|
if [[ "$IS_PPC64" -ne 0 ]]; then
|
|
|
|
IS_PPC32=0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Fixup
|
|
|
|
if [[ "$IS_ARM64" -ne 0 ]]; then
|
|
|
|
IS_ARM32=0
|
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
# Fixup
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$IS_SOLARIS" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
DISASS=dis
|
|
|
|
DISASSARGS=()
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Fixup
|
|
|
|
if [[ "$IS_DARWIN" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
DISASS=otool
|
|
|
|
DISASSARGS=("-tV")
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2021-03-09 03:14:07 +00:00
|
|
|
# Fixup
|
|
|
|
if [[ "$IS_AIX" -ne 0 ]]; then
|
|
|
|
DISASS=dis
|
|
|
|
DISASSARGS=()
|
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
# CPU features and flags
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_X86" -ne 0 || "$IS_X64" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$IS_DARWIN" -ne 0) ]]; then
|
|
|
|
X86_CPU_FLAGS=$(sysctl machdep.cpu.features 2>&1 | cut -f 2 -d ':')
|
|
|
|
elif [[ ("$IS_SOLARIS" -ne 0) ]]; then
|
|
|
|
X86_CPU_FLAGS=$(isainfo -v 2>/dev/null)
|
|
|
|
elif [[ ("$IS_FREEBSD" -ne 0) ]]; then
|
2021-03-08 22:23:11 +00:00
|
|
|
X86_CPU_FLAGS=$("$GREP" Features /var/run/dmesg.boot)
|
2020-05-10 03:16:29 +00:00
|
|
|
elif [[ ("$IS_DRAGONFLY" -ne 0) ]]; then
|
2021-03-08 22:23:11 +00:00
|
|
|
X86_CPU_FLAGS=$(dmesg | "$GREP" Features)
|
2020-05-10 03:16:29 +00:00
|
|
|
elif [[ ("$IS_HURD" -ne 0) ]]; then
|
|
|
|
: # Do nothing... cpuid is not helpful at the moment
|
|
|
|
else
|
|
|
|
X86_CPU_FLAGS="$($AWK '{IGNORECASE=1}{if ($1 == "flags"){print;exit}}' < /proc/cpuinfo | cut -f 2 -d ':')"
|
|
|
|
fi
|
2019-08-11 18:54:14 +00:00
|
|
|
elif [[ ("$IS_ARM32" -ne 0 || "$IS_ARM64" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$IS_DARWIN" -ne 0) ]]; then
|
|
|
|
ARM_CPU_FLAGS="$(sysctl machdep.cpu.features 2>&1 | cut -f 2 -d ':')"
|
2021-03-08 22:23:11 +00:00
|
|
|
# Apple M1 hardware
|
2021-03-09 00:03:36 +00:00
|
|
|
if [[ $(sysctl hw.optional.arm64 2>&1 | "$GREP" -i 'hw.optional.arm64: 1') ]]; then
|
2021-03-08 22:58:44 +00:00
|
|
|
ARM_CPU_FLAGS="asimd crc32 aes pmull sha1 sha2"
|
2021-03-08 22:23:11 +00:00
|
|
|
fi
|
2021-03-09 00:03:36 +00:00
|
|
|
if [[ $(sysctl hw.optional.armv8_2_sha3 2>&1 | "$GREP" -i 'hw.optional.armv8_2_sha3: 1') ]]; then
|
2021-03-08 22:58:44 +00:00
|
|
|
ARM_CPU_FLAGS+=" sha3"
|
2021-03-08 22:23:11 +00:00
|
|
|
fi
|
2021-03-09 00:03:36 +00:00
|
|
|
if [[ $(sysctl hw.optional.armv8_2_sha512 2>&1 | "$GREP" -i 'hw.optional.armv8_2_sha512: 1') ]]; then
|
2021-03-08 22:58:44 +00:00
|
|
|
ARM_CPU_FLAGS+=" sha512"
|
2021-03-08 06:41:40 +00:00
|
|
|
fi
|
2020-05-10 03:16:29 +00:00
|
|
|
else
|
|
|
|
ARM_CPU_FLAGS="$($AWK '{IGNORECASE=1}{if ($1 == "Features"){print;exit}}' < /proc/cpuinfo | cut -f 2 -d ':')"
|
|
|
|
fi
|
2021-03-08 22:23:11 +00:00
|
|
|
elif [[ ("$IS_PPC32" -ne 0 || "$IS_PPC64" -ne 0) ]]; then
|
|
|
|
if [[ ("$IS_DARWIN" -ne 0) ]]; then
|
2021-03-09 01:04:20 +00:00
|
|
|
PPC_CPU_FLAGS="$(sysctl -a 2>&1 | "$GREP" machdep.cpu.features | cut -f 2 -d ':')"
|
2021-03-08 22:23:11 +00:00
|
|
|
# PowerMac
|
2021-03-09 00:03:36 +00:00
|
|
|
if [[ $(sysctl hw.optional.altivec 2>&1 | "$GREP" -i 'hw.optional.altivec: 1') ]]; then
|
|
|
|
PPC_CPU_FLAGS+=" altivec"
|
2021-03-08 22:23:11 +00:00
|
|
|
fi
|
2021-03-09 02:13:43 +00:00
|
|
|
elif [[ ("$IS_AIX" -ne 0) ]]; then
|
|
|
|
CPUINFO="$(prtconf | "$GREP" -i "Processor Type" | head -n 1 | cut -f 2 -d ':')"
|
|
|
|
if echo -n "$CPUINFO" | "$GREP" -q -i -c "power9"; then
|
|
|
|
PPC_CPU_FLAGS="power9 power8 power7 altivec"
|
|
|
|
elif echo -n "$CPUINFO" | "$GREP" -q -i -c "power8"; then
|
|
|
|
PPC_CPU_FLAGS="power8 power7 altivec"
|
|
|
|
elif echo -n "$CPUINFO" | "$GREP" -q -i -c "power7"; then
|
|
|
|
PPC_CPU_FLAGS="power7 altivec"
|
|
|
|
elif echo -n "$CPUINFO" | "$GREP" -q -i -c "altivec"; then
|
|
|
|
PPC_CPU_FLAGS="altivec"
|
|
|
|
fi
|
2021-03-08 22:23:11 +00:00
|
|
|
else
|
2021-03-09 01:04:20 +00:00
|
|
|
CPUINFO="$(cat /proc/cpuinfo | grep "cpu" | head -n 1 | cut -f 2 -d ':')"
|
|
|
|
if echo -n "$CPUINFO" | "$GREP" -q -i -c "power9"; then
|
|
|
|
PPC_CPU_FLAGS="power9 power8 power7 altivec"
|
|
|
|
elif echo -n "$CPUINFO" | "$GREP" -q -i -c "power8"; then
|
|
|
|
PPC_CPU_FLAGS="power8 power7 altivec"
|
|
|
|
elif echo -n "$CPUINFO" | "$GREP" -q -i -c "power7"; then
|
|
|
|
PPC_CPU_FLAGS="power7 altivec"
|
|
|
|
elif echo -n "$CPUINFO" | "$GREP" -q -i -c "altivec"; then
|
|
|
|
PPC_CPU_FLAGS="altivec"
|
|
|
|
fi
|
2021-03-08 22:23:11 +00:00
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
for ARG in "$@"
|
|
|
|
do
|
2020-05-10 03:16:29 +00:00
|
|
|
# Recognize "fast" and "quick", which does not perform tests that take more time to execute
|
2017-08-29 12:57:04 +00:00
|
|
|
if [[ ($("$GREP" -ix "fast" <<< "$ARG") || $("$GREP" -ix "quick" <<< "$ARG")) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_VALGRIND=0
|
|
|
|
WANT_BENCHMARKS=0
|
|
|
|
# Recognize "farm" and "nice", which uses 1/2 the CPU cores in accordance with GCC Compile Farm policy
|
|
|
|
elif [[ ($("$GREP" -ix "farm" <<< "$ARG") || $("$GREP" -ix "nice" <<< "$ARG")) ]]; then
|
|
|
|
WANT_NICE=1
|
|
|
|
elif [[ ($("$GREP" -ix "orig" <<< "$ARG") || $("$GREP" -ix "original" <<< "$ARG") || $("$GREP" -ix "config.h" <<< "$ARG")) ]]; then
|
|
|
|
git checkout config.h &>/dev/null
|
|
|
|
else
|
|
|
|
echo "Unknown option $ARG"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
# We need to use the C++ compiler to determine feature availablility. Otherwise
|
|
|
|
# mis-detections occur on a number of platforms.
|
|
|
|
if [[ ((-z "$CXX") || ("$CXX" == "gcc")) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$CXX" == "gcc") ]]; then
|
|
|
|
CXX="g++"
|
|
|
|
elif [[ "$IS_DARWIN" -ne 0 ]]; then
|
|
|
|
CXX="c++"
|
|
|
|
elif [[ "$IS_SOLARIS" -ne 0 ]]; then
|
2020-05-10 03:56:35 +00:00
|
|
|
if [[ (-e "/opt/developerstudio12.7/bin/CC") ]]; then
|
|
|
|
CXX="/opt/developerstudio12.7/bin/CC"
|
|
|
|
elif [[ (-e "/opt/developerstudio12.6/bin/CC") ]]; then
|
|
|
|
CXX="/opt/developerstudio12.6/bin/CC"
|
|
|
|
elif [[ (-e "/opt/developerstudio12.5/bin/CC") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
CXX="/opt/developerstudio12.5/bin/CC"
|
|
|
|
elif [[ (-e "/opt/solarisstudio12.4/bin/CC") ]]; then
|
|
|
|
CXX="/opt/solarisstudio12.4/bin/CC"
|
|
|
|
elif [[ (-e "/opt/solarisstudio12.3/bin/CC") ]]; then
|
|
|
|
CXX="/opt/solarisstudio12.3/bin/CC"
|
|
|
|
elif [[ (-e "/opt/solstudio12.2/bin/CC") ]]; then
|
|
|
|
CXX="/opt/solstudio12.2/bin/CC"
|
|
|
|
elif [[ (-e "/opt/solstudio12.1/bin/CC") ]]; then
|
|
|
|
CXX="/opt/solstudio12.1/bin/CC"
|
|
|
|
elif [[ (-e "/opt/solstudio12.0/bin/CC") ]]; then
|
|
|
|
CXX="/opt/solstudio12.0/bin/CC"
|
|
|
|
elif [[ $(command -v CC 2>/dev/null) ]]; then
|
|
|
|
CXX="CC"
|
|
|
|
elif [[ $(command -v g++ 2>/dev/null) ]]; then
|
|
|
|
CXX="g++"
|
|
|
|
else
|
|
|
|
CXX=CC
|
|
|
|
fi
|
|
|
|
elif [[ $(command -v g++ 2>/dev/null) ]]; then
|
|
|
|
CXX="g++"
|
|
|
|
else
|
|
|
|
CXX="c++"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2017-08-29 12:57:04 +00:00
|
|
|
SUN_COMPILER=$("$CXX" -V 2>&1 | "$GREP" -i -c -E "CC: (Sun|Studio)")
|
|
|
|
GCC_COMPILER=$("$CXX" --version 2>&1 | "$GREP" -i -v "clang" | "$GREP" -i -c -E "(gcc|g\+\+)")
|
2017-09-09 18:56:47 +00:00
|
|
|
XLC_COMPILER=$("$CXX" -qversion 2>&1 | "$GREP" -i -c "IBM XL")
|
2017-08-29 12:57:04 +00:00
|
|
|
INTEL_COMPILER=$("$CXX" --version 2>&1 | "$GREP" -i -c "\(icc\)")
|
|
|
|
MACPORTS_COMPILER=$("$CXX" --version 2>&1 | "$GREP" -i -c "MacPorts")
|
|
|
|
CLANG_COMPILER=$("$CXX" --version 2>&1 | "$GREP" -i -c "clang")
|
2017-09-18 06:45:03 +00:00
|
|
|
GNU_LINKER=$(ld --version 2>&1 | "$GREP" -i -c "GNU ld")
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$SUN_COMPILER" -eq 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
AMD64=$("$CXX" -dM -E - </dev/null 2>/dev/null | "$GREP" -i -c -E "(__x64_64__|__amd64__)")
|
|
|
|
ILP32=$("$CXX" -dM -E - </dev/null 2>/dev/null | "$GREP" -i -c -E "(__ILP32__|__ILP32)")
|
|
|
|
if [[ ("$AMD64" -ne 0) && ("$ILP32" -ne 0) ]]; then
|
|
|
|
IS_X32=1
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Now that the compiler is fixed, determine the compiler version for fixups
|
2020-05-10 03:48:08 +00:00
|
|
|
CXX_VERSION=$("$CXX" -v 2>&1)
|
2020-05-11 19:22:20 +00:00
|
|
|
GCC_4_8=$("$GREP" -i -c -E 'gcc version 4\.8' <<< "$CXX_VERSION")
|
|
|
|
GCC_4_8_OR_ABOVE=$("$GREP" -i -c -E 'gcc version (4\.[8-9]|[5-9]\.[0-9])' <<< "$CXX_VERSION")
|
|
|
|
GCC_11_0_OR_ABOVE=$("$GREP" -i -c -E 'gcc \(GCC\) (1[1-9]\.|[2-9][0-9]\.)' <<< "$CXX_VERSION")
|
2020-05-10 03:48:08 +00:00
|
|
|
|
|
|
|
CXX_VERSION=$("$CXX" -V 2>&1)
|
2020-05-11 19:22:20 +00:00
|
|
|
SUNCC_5_10_OR_ABOVE=$("$GREP" -c -E "CC: (Sun|Studio) .* (5\.1[0-9]|5\.[2-9]|[6-9]\.)" <<< "$CXX_VERSION")
|
2016-09-23 15:32:14 +00:00
|
|
|
|
|
|
|
# Fixup, bad code generation
|
2020-05-11 19:22:20 +00:00
|
|
|
if [[ ("$SUNCC_5_10_OR_ABOVE" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_OFAST=0
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2020-05-11 19:22:20 +00:00
|
|
|
# Fixup, Analyzer available in GCC 10.0, but C++ is not planned until GCC 11.
|
|
|
|
if [[ ("$GCC_COMPILER" -ne 0) && ("$GCC_11_0_OR_ABOVE" -ne 0) ]]; then
|
|
|
|
HAVE_ANALYZER=0
|
|
|
|
fi
|
|
|
|
|
2017-08-14 05:48:11 +00:00
|
|
|
# GCC compile farm is mounted RO
|
2021-02-07 16:44:15 +00:00
|
|
|
if [[ (-z "${TMPDIR}") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ (-d "/tmp") ]] && [[ $(touch "/tmp/ok-to-delete" &>/dev/null) ]]; then
|
|
|
|
TMPDIR=/tmp
|
|
|
|
rm -f "/tmp/ok-to-delete"
|
|
|
|
elif [[ (-d "/temp") ]]; then
|
|
|
|
TMPDIR=/temp
|
|
|
|
elif [[ (-d "$HOME/tmp") ]]; then
|
|
|
|
TMPDIR="$HOME/tmp"
|
|
|
|
else
|
|
|
|
echo "Please set TMPDIR to a valid directory"
|
|
|
|
exit 1
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2017-08-14 05:48:11 +00:00
|
|
|
# Make temp if it does not exist
|
2021-02-07 16:44:15 +00:00
|
|
|
mkdir -p "${TMPDIR}" &>/dev/null
|
2017-08-14 05:48:11 +00:00
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
if [[ (-z "$HAVE_CXX17") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_CXX17=0
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -std=c++17 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_CXX17=1
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
if [[ (-z "$HAVE_GNU17") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_GNU17=0
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -std=gnu++17 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_GNU17=1
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2018-01-06 10:00:24 +00:00
|
|
|
if [[ (-z "$HAVE_CXX20") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_CXX20=0
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -std=c++20 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_CXX20=1
|
|
|
|
fi
|
2018-01-06 10:00:24 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2018-01-06 10:00:24 +00:00
|
|
|
if [[ (-z "$HAVE_GNU20") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_GNU20=0
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -std=gnu++20 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_GNU20=1
|
|
|
|
fi
|
2018-01-06 10:00:24 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
if [[ (-z "$HAVE_CXX14") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_CXX14=0
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -std=c++14 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_CXX14=1
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
if [[ (-z "$HAVE_GNU14") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_GNU14=0
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -std=gnu++14 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_GNU14=1
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
if [[ (-z "$HAVE_CXX11") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_CXX11=0
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -std=c++11 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_CXX11=1
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
if [[ (-z "$HAVE_GNU11") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_GNU11=0
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -std=gnu++11 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_GNU11=1
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
if [[ (-z "$HAVE_CXX03") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_CXX03=0
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -std=c++03 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_CXX03=1
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
if [[ (-z "$HAVE_GNU03") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_GNU03=0
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -std=gnu++03 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_GNU03=1
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2021-03-06 09:08:03 +00:00
|
|
|
# Apple M1's do not do the -stdlib=libstdc++ thing
|
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
if [[ (-z "$HAVE_LIBSTDCXX") ]]; then
|
|
|
|
HAVE_LIBSTDCXX=0
|
|
|
|
"$CXX" -stdlib=libstdc++ "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_LIBSTDCXX=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
# Use a fallback strategy so OPT_O0 can be used with DEBUG_CXXFLAGS
|
|
|
|
OPT_O0=
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -O0 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
OPT_O0=-O0
|
2016-09-23 15:32:14 +00:00
|
|
|
else
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -xO0 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
|
|
|
OPT_O0=-xO0
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Use a fallback strategy so OPT_O1 can be used with VALGRIND_CXXFLAGS
|
|
|
|
OPT_O1=
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -O1 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_O1=1
|
|
|
|
OPT_O1=-O1
|
2016-09-23 15:32:14 +00:00
|
|
|
else
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -xO1 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
|
|
|
HAVE_O1=1
|
|
|
|
OPT_O1=-xO1
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2018-02-21 08:22:34 +00:00
|
|
|
# https://github.com/weidai11/cryptopp/issues/588
|
|
|
|
OPT_O2=
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -O2 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_O2=1
|
|
|
|
OPT_O2=-O2
|
2018-02-21 08:22:34 +00:00
|
|
|
else
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -xO2 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
|
|
|
HAVE_O2=1
|
|
|
|
OPT_O2=-xO2
|
|
|
|
fi
|
2018-02-21 08:22:34 +00:00
|
|
|
fi
|
|
|
|
|
2017-08-30 12:32:20 +00:00
|
|
|
# Use a fallback strategy so OPT_O3 can be used with RELEASE_CXXFLAGS
|
|
|
|
OPT_O3=
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -O3 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_O3=1
|
|
|
|
OPT_O3=-O3
|
2017-08-30 12:32:20 +00:00
|
|
|
else
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -xO3 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
|
|
|
HAVE_O3=1
|
|
|
|
OPT_O3=-xO3
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Hit or miss, mostly hit
|
|
|
|
if [[ (-z "$HAVE_OS") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_OS=0
|
|
|
|
OPT_OS=
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -Os "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
|
|
|
HAVE_OS=1
|
|
|
|
OPT_OS=-Os
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-07 17:10:46 +00:00
|
|
|
# Hit or miss, mostly hit
|
|
|
|
if [[ (-z "$HAVE_OZ") ]]; then
|
|
|
|
HAVE_OZ=0
|
|
|
|
OPT_OZ=
|
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -Oz "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
|
|
|
HAVE_OZ=1
|
|
|
|
OPT_OZ=-Oz
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
# Hit or miss, mostly hit
|
|
|
|
if [[ (-z "$HAVE_OFAST") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_OFAST=0
|
|
|
|
OPT_OFAST=
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -Ofast "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
|
|
|
HAVE_OFAST=1
|
|
|
|
OPT_OFAST=-Ofast
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Use a fallback strategy so OPT_G2 can be used with RELEASE_CXXFLAGS
|
|
|
|
OPT_G2=
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -g2 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
OPT_G2=-g2
|
2016-09-23 15:32:14 +00:00
|
|
|
else
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -g "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
|
|
|
OPT_G2=-g
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Use a fallback strategy so OPT_G3 can be used with DEBUG_CXXFLAGS
|
|
|
|
OPT_G3=
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -g3 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
OPT_G3=-g3
|
2016-09-23 15:32:14 +00:00
|
|
|
else
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -g "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
|
|
|
OPT_G3=-g
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2016-10-26 07:10:52 +00:00
|
|
|
# Cygwin and noisy compiles
|
|
|
|
OPT_PIC=
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-10-26 07:10:52 +00:00
|
|
|
if [[ (-z "$HAVE_PIC") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_PIC=0
|
2021-02-07 16:44:15 +00:00
|
|
|
PIC_PROBLEMS=$("$CXX" -fPIC "$test_prog" -o "${TMPDIR}/test.exe" 2>&1 | "$GREP" -i -c -E '(warning|error)')
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$PIC_PROBLEMS" -eq 0 ]]; then
|
|
|
|
HAVE_PIC=1
|
|
|
|
OPT_PIC=-fPIC
|
|
|
|
if [[ ("$XLC_COMPILER" -eq 1) ]]; then
|
|
|
|
OPT_PIC=-qpic
|
|
|
|
fi
|
|
|
|
fi
|
2016-10-26 07:10:52 +00:00
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
# GCC 4.8; Clang 3.4
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
if [[ (-z "$HAVE_UBSAN") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_UBSAN=0
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -fsanitize=undefined "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
|
|
|
HAVE_UBSAN=1
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# GCC 4.8; Clang 3.4
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
if [[ (-z "$HAVE_ASAN") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_ASAN=0
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -fsanitize=address "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
|
|
|
HAVE_ASAN=1
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# GCC 6.0; maybe Clang
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2017-01-27 11:31:55 +00:00
|
|
|
if [[ (-z "$HAVE_BSAN") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_BSAN=0
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -fsanitize=bounds-strict "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
|
|
|
HAVE_BSAN=1
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2020-05-11 19:22:20 +00:00
|
|
|
# Analyzer available in GCC 10.0, but C++ is not planned until GCC 11.
|
2020-05-09 21:55:44 +00:00
|
|
|
# https://developers.redhat.com/blog/2020/03/26/static-analysis-in-gcc-10/
|
2020-05-11 19:22:20 +00:00
|
|
|
# and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95031#c2.
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-11 19:22:20 +00:00
|
|
|
if [[ (-z "$HAVE_ANALYZER") ]]; then
|
|
|
|
HAVE_ANALYZER=0
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -fanalyzer "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
2020-05-11 19:22:20 +00:00
|
|
|
HAVE_ANALYZER=1
|
2020-05-10 03:16:29 +00:00
|
|
|
fi
|
|
|
|
fi
|
2020-05-09 21:55:44 +00:00
|
|
|
fi
|
|
|
|
|
2017-10-30 12:19:50 +00:00
|
|
|
# GCC 8.0; maybe Clang?
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2017-10-30 12:19:50 +00:00
|
|
|
if [[ (-z "$HAVE_CET") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_CET=0
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -fcf-protection=full -mcet "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
|
|
|
HAVE_CET=1
|
|
|
|
fi
|
|
|
|
fi
|
2017-10-30 12:19:50 +00:00
|
|
|
fi
|
|
|
|
|
2018-02-21 09:23:46 +00:00
|
|
|
# Meltdown and Specter. This is the Reptoline fix
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2018-02-21 09:23:46 +00:00
|
|
|
if [[ (-z "$HAVE_REPTOLINE") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_REPTOLINE=0
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -mfunction-return=thunk -mindirect-branch=thunk "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
|
|
|
HAVE_REPTOLINE=1
|
|
|
|
fi
|
|
|
|
fi
|
2018-02-21 09:23:46 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
if [[ (-z "$HAVE_OMP") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_OMP=0
|
|
|
|
if [[ "$GCC_COMPILER" -ne 0 ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -fopenmp -O3 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_OMP=1
|
|
|
|
OMP_FLAGS=("-fopenmp" "-O3")
|
|
|
|
fi
|
|
|
|
elif [[ "$INTEL_COMPILER" -ne 0 ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -openmp -O3 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_OMP=1
|
|
|
|
OMP_FLAGS=("-openmp" "-O3")
|
|
|
|
fi
|
|
|
|
elif [[ "$CLANG_COMPILER" -ne 0 ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -fopenmp=libomp -O3 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_OMP=1
|
|
|
|
OMP_FLAGS=("-fopenmp=libomp" "-O3")
|
|
|
|
fi
|
|
|
|
elif [[ "$SUN_COMPILER" -ne 0 ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -xopenmp=parallel -xO3 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_OMP=1
|
|
|
|
OMP_FLAGS=("-xopenmp=parallel" "-xO3")
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
if [[ (-z "$HAVE_INTEL_MULTIARCH") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_INTEL_MULTIARCH=0
|
|
|
|
if [[ ("$IS_DARWIN" -ne 0) && ("$IS_X86" -ne 0 || "$IS_X64" -ne 0) ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -arch i386 -arch x86_64 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_INTEL_MULTIARCH=1
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
if [[ (-z "$HAVE_PPC_MULTIARCH") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_PPC_MULTIARCH=0
|
|
|
|
if [[ ("$IS_DARWIN" -ne 0) && ("$IS_PPC32" -ne 0 || "$IS_PPC64" -ne 0) ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -arch ppc -arch ppc64 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_PPC_MULTIARCH=1
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
if [[ (-z "$HAVE_X32") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_X32=0
|
|
|
|
if [[ "$IS_X32" -ne 0 ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -mx32 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_X32=1
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2017-04-23 11:38:25 +00:00
|
|
|
# Hit or miss, mostly hit
|
|
|
|
if [[ (-z "$HAVE_NATIVE_ARCH") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_NATIVE_ARCH=0
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -march=native "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$?" -eq 0) ]]; then
|
|
|
|
HAVE_NATIVE_ARCH=1
|
|
|
|
fi
|
2017-04-23 11:38:25 +00:00
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
# ld-gold linker testing
|
|
|
|
if [[ (-z "$HAVE_LDGOLD") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_LDGOLD=0
|
|
|
|
LD_GOLD=$(command -v ld.gold 2>/dev/null)
|
|
|
|
ELF_FILE=$(command -v file 2>/dev/null)
|
|
|
|
if [[ (-n "$LD_GOLD") && (-n "$ELF_FILE") ]]; then
|
|
|
|
LD_GOLD=$(file "$LD_GOLD" | cut -d":" -f 2 | "$GREP" -i -c "elf")
|
|
|
|
if [[ ("$LD_GOLD" -ne 0) ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -fuse-ld=gold "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_LDGOLD=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# ARMv7 and ARMv8, including NEON, CRC32 and Crypto extensions
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_ARM32" -ne 0 || "$IS_ARM64" -ne 0) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ (-z "$HAVE_ARMV7A" && "$IS_ARM32" -ne 0) ]]; then
|
2021-03-09 00:03:36 +00:00
|
|
|
HAVE_ARMV7A=$("$GREP" -i -c 'neon' <<< "$ARM_CPU_FLAGS")
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$HAVE_ARMV7A" -gt 0) ]]; then HAVE_ARMV7A=1; fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2021-03-09 03:14:07 +00:00
|
|
|
if [[ (-z "$HAVE_ARMV8" && ("$IS_ARM32" -ne 0 || "$IS_ARM64" -ne 0)) ]]; then
|
|
|
|
HAVE_ARMV8=$("$GREP" -i -c -E '(asimd|crc|crypto)' <<< "$ARM_CPU_FLAGS")
|
|
|
|
if [[ ("$HAVE_ARMV8" -gt 0) ]]; then HAVE_ARMV8=1; fi
|
2020-05-10 03:16:29 +00:00
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ (-z "$HAVE_ARM_VFPV3") ]]; then
|
2021-03-09 00:03:36 +00:00
|
|
|
HAVE_ARM_VFPV3=$("$GREP" -i -c 'vfpv3' <<< "$ARM_CPU_FLAGS")
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$HAVE_ARM_VFPV3" -gt 0) ]]; then HAVE_ARM_VFPV3=1; fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ (-z "$HAVE_ARM_VFPV4") ]]; then
|
2021-03-09 00:03:36 +00:00
|
|
|
HAVE_ARM_VFPV4=$("$GREP" -i -c 'vfpv4' <<< "$ARM_CPU_FLAGS")
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$HAVE_ARM_VFPV4" -gt 0) ]]; then HAVE_ARM_VFPV4=1; fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ (-z "$HAVE_ARM_VFPV5") ]]; then
|
2021-03-09 00:03:36 +00:00
|
|
|
HAVE_ARM_VFPV5=$("$GREP" -i -c 'fpv5' <<< "$ARM_CPU_FLAGS")
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$HAVE_ARM_VFPV5" -gt 0) ]]; then HAVE_ARM_VFPV5=1; fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ (-z "$HAVE_ARM_VFPD32") ]]; then
|
2021-03-09 00:03:36 +00:00
|
|
|
HAVE_ARM_VFPD32=$("$GREP" -i -c 'vfpd32' <<< "$ARM_CPU_FLAGS")
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$HAVE_ARM_VFPD32" -gt 0) ]]; then HAVE_ARM_VFPD32=1; fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ (-z "$HAVE_ARM_NEON") ]]; then
|
2021-03-09 00:03:36 +00:00
|
|
|
HAVE_ARM_NEON=$("$GREP" -i -c 'neon' <<< "$ARM_CPU_FLAGS")
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$HAVE_ARM_NEON" -gt 0) ]]; then HAVE_ARM_NEON=1; fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2021-03-08 22:23:11 +00:00
|
|
|
if [[ (-z "$HAVE_ARM_CRC") ]]; then
|
2021-03-09 00:03:36 +00:00
|
|
|
HAVE_ARM_CRC=$("$GREP" -i -c 'crc32' <<< "$ARM_CPU_FLAGS")
|
2021-03-08 22:23:11 +00:00
|
|
|
if [[ ("$HAVE_ARM_CRC" -gt 0) ]]; then HAVE_ARM_CRC=1; fi
|
|
|
|
fi
|
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ (-z "$HAVE_ARM_CRYPTO") ]]; then
|
2021-03-09 00:03:36 +00:00
|
|
|
HAVE_ARM_CRYPTO=$("$GREP" -i -c -E '(aes|pmull|sha1|sha2)' <<< "$ARM_CPU_FLAGS")
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$HAVE_ARM_CRYPTO" -gt 0) ]]; then HAVE_ARM_CRYPTO=1; fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2021-03-08 22:23:11 +00:00
|
|
|
if [[ (-z "$HAVE_ARM_SHA3") ]]; then
|
2021-03-09 00:03:36 +00:00
|
|
|
HAVE_ARM_SHA3=$("$GREP" -i -c 'sha3' <<< "$ARM_CPU_FLAGS")
|
2021-03-08 22:23:11 +00:00
|
|
|
if [[ ("$HAVE_ARM_SHA3" -gt 0) ]]; then HAVE_ARM_SHA3=1; fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ (-z "$HAVE_ARM_SHA512") ]]; then
|
2021-03-09 00:03:36 +00:00
|
|
|
HAVE_ARM_SHA512=$("$GREP" -i -c 'sha512' <<< "$ARM_CPU_FLAGS")
|
2021-03-08 22:23:11 +00:00
|
|
|
if [[ ("$HAVE_ARM_SHA512" -gt 0) ]]; then HAVE_ARM_SHA512=1; fi
|
2020-05-10 03:16:29 +00:00
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2021-03-09 00:03:36 +00:00
|
|
|
if [[ ("$IS_PPC32" -ne 0 || "$IS_PPC64" -ne 0) ]]; then
|
|
|
|
if [[ (-z "$HAVE_PPC_ALTIVEC") ]]; then
|
|
|
|
HAVE_PPC_ALTIVEC=$("$GREP" -i -c 'altivec' <<< "$PPC_CPU_FLAGS")
|
|
|
|
if [[ ("$HAVE_PPC_ALTIVEC" -gt 0) ]]; then HAVE_PPC_ALTIVEC=1; fi
|
|
|
|
fi
|
|
|
|
if [[ (-z "$HAVE_PPC_POWER7") ]]; then
|
|
|
|
HAVE_PPC_POWER7=$("$GREP" -i -c -E 'pwr7|power7' <<< "$PPC_CPU_FLAGS")
|
|
|
|
if [[ ("$HAVE_PPC_POWER7" -gt 0) ]]; then HAVE_PPC_POWER7=1; fi
|
|
|
|
fi
|
|
|
|
if [[ (-z "$HAVE_PPC_POWER8") ]]; then
|
|
|
|
HAVE_PPC_POWER8=$("$GREP" -i -c -E 'pwr8|power8' <<< "$PPC_CPU_FLAGS")
|
|
|
|
if [[ ("$HAVE_PPC_POWER8" -gt 0) ]]; then HAVE_PPC_POWER8=1; fi
|
|
|
|
fi
|
|
|
|
if [[ (-z "$HAVE_PPC_POWER9") ]]; then
|
|
|
|
HAVE_PPC_POWER9=$("$GREP" -i -c -E 'pwr9|power9' <<< "$PPC_CPU_FLAGS")
|
|
|
|
if [[ ("$HAVE_PPC_POWER9" -gt 0) ]]; then HAVE_PPC_POWER9=1; fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
# Valgrind testing of C++03, C++11, C++14 and C++17 binaries. Valgrind tests take a long time...
|
|
|
|
if [[ (-z "$HAVE_VALGRIND") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ $(command -v valgrind 2>/dev/null) ]]; then
|
|
|
|
HAVE_VALGRIND=1
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Try to find a symbolizer for Asan
|
2020-05-09 21:55:44 +00:00
|
|
|
if [[ (-z "$HAVE_SYMBOLIZE") && (-n "$ASAN_SYMBOLIZER_PATH") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
# Sets default value
|
|
|
|
if [[ $(command -v asan_symbolize 2>/dev/null) ]]; then
|
|
|
|
HAVE_SYMBOLIZE=1
|
|
|
|
fi
|
|
|
|
if [[ (("$HAVE_SYMBOLIZE" -ne 0) && (-z "$ASAN_SYMBOLIZE")) ]]; then
|
|
|
|
ASAN_SYMBOLIZE=asan_symbolize
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Clang implicitly uses ASAN_SYMBOLIZER_PATH; set it if its not set.
|
|
|
|
if [[ (-z "$ASAN_SYMBOLIZER_PATH") ]]; then
|
|
|
|
if [[ $(command -v llvm-symbolizer 2>/dev/null) ]]; then
|
|
|
|
LLVM_SYMBOLIZER_FOUND=1;
|
|
|
|
fi
|
|
|
|
if [[ ("$LLVM_SYMBOLIZER_FOUND" -ne 0) ]]; then
|
|
|
|
ASAN_SYMBOLIZER_PATH=$(command -v llvm-symbolizer)
|
|
|
|
export ASAN_SYMBOLIZER_PATH
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Used to disassemble object modules so we can verify some aspects of code generation
|
|
|
|
if [[ (-z "$HAVE_DISASS") ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
echo "int main(int argc, char* argv[]) {return 0;}" > "${TMPDIR}/test.cc"
|
|
|
|
"$CXX" "${TMPDIR}/test.cc" -o "${TMPDIR}/testest.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$DISASS" "${DISASSARGS[@]}" "${TMPDIR}/testest.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
HAVE_DISASS=1
|
|
|
|
else
|
|
|
|
HAVE_DISASS=0
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2017-11-13 01:32:41 +00:00
|
|
|
# LD_LIBRARY_PATH and DYLD_LIBRARY_PATH
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$IS_LINUX" -ne 0 || "$IS_SOLARIS" -ne 0 || "$IS_BSD" -ne 0 ]]; then
|
2017-11-13 01:32:41 +00:00
|
|
|
HAVE_LD_LIBRARY_PATH=1
|
|
|
|
fi
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$IS_DARWIN" -ne 0 ]]; then
|
2017-11-13 01:32:41 +00:00
|
|
|
HAVE_DYLD_LIBRARY_PATH=1
|
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
# Fixup... GCC 4.8 ASAN produces false positives under ARM
|
2020-05-11 19:22:20 +00:00
|
|
|
if [[ ( ("$IS_ARM32" -ne 0 || "$IS_ARM64" -ne 0) && "$GCC_4_8" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_ASAN=0
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Benchmarks take a long time...
|
|
|
|
if [[ (-z "$WANT_BENCHMARKS") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
WANT_BENCHMARKS=1
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2017-09-09 22:44:08 +00:00
|
|
|
# IBM XL C/C++ compiler fixups. Not sure why it fails to return non-0 on failure...
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$XLC_COMPILER" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_CXX03=0
|
|
|
|
HAVE_GNU03=0
|
|
|
|
HAVE_CXX11=0
|
|
|
|
HAVE_GNU11=0
|
|
|
|
HAVE_CXX14=0
|
|
|
|
HAVE_GNU14=0
|
|
|
|
HAVE_CXX17=0
|
|
|
|
HAVE_GNU17=0
|
|
|
|
HAVE_CXX20=0
|
|
|
|
HAVE_GNU20=0
|
|
|
|
HAVE_OMP=0
|
|
|
|
HAVE_CET=0
|
|
|
|
HAVE_REPTOLINE=0
|
|
|
|
HAVE_ASAN=0
|
|
|
|
HAVE_BSAN=0
|
|
|
|
HAVE_UBSAN=0
|
2020-05-11 19:22:20 +00:00
|
|
|
HAVE_ANALYZER=0
|
2020-05-10 03:16:29 +00:00
|
|
|
HAVE_LDGOLD=0
|
2017-09-09 22:44:08 +00:00
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
############################################
|
|
|
|
# System information
|
|
|
|
|
2021-02-07 17:16:26 +00:00
|
|
|
echo "" | tee -a "$TEST_RESULTS"
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$IS_LINUX" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "IS_LINUX: $IS_LINUX" | tee -a "$TEST_RESULTS"
|
2019-08-11 18:54:14 +00:00
|
|
|
elif [[ "$IS_CYGWIN" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "IS_CYGWIN: $IS_CYGWIN" | tee -a "$TEST_RESULTS"
|
2019-08-11 18:54:14 +00:00
|
|
|
elif [[ "$IS_MINGW" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "IS_MINGW: $IS_MINGW" | tee -a "$TEST_RESULTS"
|
2019-08-11 18:54:14 +00:00
|
|
|
elif [[ "$IS_SOLARIS" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "IS_SOLARIS: $IS_SOLARIS" | tee -a "$TEST_RESULTS"
|
2019-08-11 18:54:14 +00:00
|
|
|
elif [[ "$IS_DARWIN" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "IS_DARWIN: $IS_DARWIN" | tee -a "$TEST_RESULTS"
|
2019-08-11 18:54:14 +00:00
|
|
|
elif [[ "$IS_AIX" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "IS_AIX: $IS_AIX" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$IS_PPC64" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "IS_PPC64: $IS_PPC64" | tee -a "$TEST_RESULTS"
|
2019-08-11 18:54:14 +00:00
|
|
|
elif [[ "$IS_PPC32" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "IS_PPC32: $IS_PPC32" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$IS_ARM64" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "IS_ARM64: $IS_ARM64" | tee -a "$TEST_RESULTS"
|
2019-08-11 18:54:14 +00:00
|
|
|
elif [[ "$IS_ARM32" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "IS_ARM32: $IS_ARM32" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_ARMV7A" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "HAVE_ARMV7A: $HAVE_ARMV7A" | tee -a "$TEST_RESULTS"
|
2021-03-09 03:14:07 +00:00
|
|
|
elif [[ "$HAVE_ARMV8" -ne 0 ]]; then
|
|
|
|
echo "HAVE_ARMV8: $HAVE_ARMV8" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_ARM_NEON" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "HAVE_ARM_NEON: $HAVE_ARM_NEON" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_ARM_VFPD32" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "HAVE_ARM_VFPD32: $HAVE_ARM_VFPD32" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_ARM_VFPV3" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "HAVE_ARM_VFPV3: $HAVE_ARM_VFPV3" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_ARM_VFPV4" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "HAVE_ARM_VFPV4: $HAVE_ARM_VFPV4" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_ARM_CRC" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "HAVE_ARM_CRC: $HAVE_ARM_CRC" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_ARM_CRYPTO" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "HAVE_ARM_CRYPTO: $HAVE_ARM_CRYPTO" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
2021-03-08 22:23:11 +00:00
|
|
|
if [[ "$HAVE_ARM_SHA3" -ne 0 ]]; then
|
|
|
|
echo "HAVE_ARM_SHA3: $HAVE_ARM_SHA3" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
if [[ "$HAVE_ARM_SHA512" -ne 0 ]]; then
|
|
|
|
echo "HAVE_ARM_SHA512: $HAVE_ARM_SHA512" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
2021-03-09 00:03:36 +00:00
|
|
|
if [[ "$HAVE_PPC_ALTIVEC" -ne 0 ]]; then
|
|
|
|
echo "HAVE_PPC_ALTIVEC: $HAVE_PPC_ALTIVEC" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
if [[ "$HAVE_PPC_POWER7" -ne 0 ]]; then
|
|
|
|
echo "HAVE_PPC_POWER7: $HAVE_PPC_POWER7" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
if [[ "$HAVE_PPC_POWER8" -ne 0 ]]; then
|
|
|
|
echo "HAVE_PPC_POWER8: $HAVE_PPC_POWER8" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
if [[ "$HAVE_PPC_POWER9" -ne 0 ]]; then
|
|
|
|
echo "HAVE_PPC_POWER9: $HAVE_PPC_POWER9" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$IS_X32" -ne 0 ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
echo "IS_X32: $IS_X32" | tee -a "$TEST_RESULTS"
|
2019-08-11 18:54:14 +00:00
|
|
|
elif [[ "$IS_X64" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "IS_X64: $IS_X64" | tee -a "$TEST_RESULTS"
|
2019-08-11 18:54:14 +00:00
|
|
|
elif [[ "$IS_X86" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "IS_X86: $IS_X86" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$IS_S390" -ne 0 ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
echo "IS_S390: $IS_S390" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# C++03, C++11, C++14 and C++17
|
2021-02-07 17:16:26 +00:00
|
|
|
echo "" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
echo "HAVE_CXX03: $HAVE_CXX03" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "HAVE_GNU03: $HAVE_GNU03" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "HAVE_CXX11: $HAVE_CXX11" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "HAVE_GNU11: $HAVE_GNU11" | tee -a "$TEST_RESULTS"
|
2021-03-06 09:22:53 +00:00
|
|
|
echo "HAVE_CXX14: $HAVE_CXX14" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "HAVE_GNU14: $HAVE_GNU14" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "HAVE_CXX17: $HAVE_CXX17" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "HAVE_GNU17: $HAVE_GNU17" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "HAVE_CXX20: $HAVE_CXX20" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "HAVE_GNU20: $HAVE_GNU20" | tee -a "$TEST_RESULTS"
|
2021-02-07 17:16:26 +00:00
|
|
|
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_LDGOLD" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "HAVE_LDGOLD: $HAVE_LDGOLD" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2020-05-09 21:55:44 +00:00
|
|
|
# -O2, -O3, -Os and -Ofast
|
2021-02-07 17:16:26 +00:00
|
|
|
echo "" | tee -a "$TEST_RESULTS"
|
2018-02-21 08:22:34 +00:00
|
|
|
echo "OPT_O2: $OPT_O2" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
echo "OPT_O3: $OPT_O3" | tee -a "$TEST_RESULTS"
|
2021-02-07 17:16:26 +00:00
|
|
|
if [[ ("$HAVE_OS" -eq 1) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "OPT_OS: $OPT_OS" | tee -a "$TEST_RESULTS"
|
2021-02-07 17:16:26 +00:00
|
|
|
fi
|
|
|
|
if [[ ("$HAVE_OZ" -eq 1) ]]; then
|
2021-02-07 17:10:46 +00:00
|
|
|
echo "OPT_OZ: $OPT_OZ" | tee -a "$TEST_RESULTS"
|
2021-02-07 17:16:26 +00:00
|
|
|
fi
|
|
|
|
if [[ ("$HAVE_OFAST" -eq 1) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "OPT_OFAST: $OPT_OFAST" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Tools available for testing
|
2021-02-07 17:16:26 +00:00
|
|
|
echo "" | tee -a "$TEST_RESULTS"
|
2020-05-09 21:55:44 +00:00
|
|
|
if [[ ((-n "$HAVE_OMP") && ("$HAVE_OMP" -ne 0)) ]]; then echo "HAVE_OMP: $HAVE_OMP" | tee -a "$TEST_RESULTS"; fi
|
2016-09-23 15:32:14 +00:00
|
|
|
echo "HAVE_ASAN: $HAVE_ASAN" | tee -a "$TEST_RESULTS"
|
2020-05-09 21:55:44 +00:00
|
|
|
if [[ ("$HAVE_ASAN" -ne 0) && (-n "$ASAN_SYMBOLIZE") ]]; then echo "ASAN_SYMBOLIZE: $ASAN_SYMBOLIZE" | tee -a "$TEST_RESULTS"; fi
|
2016-09-23 15:32:14 +00:00
|
|
|
echo "HAVE_UBSAN: $HAVE_UBSAN" | tee -a "$TEST_RESULTS"
|
2017-01-27 11:31:55 +00:00
|
|
|
echo "HAVE_BSAN: $HAVE_BSAN" | tee -a "$TEST_RESULTS"
|
2017-10-30 12:19:50 +00:00
|
|
|
echo "HAVE_CET: $HAVE_CET" | tee -a "$TEST_RESULTS"
|
2020-05-11 19:22:20 +00:00
|
|
|
echo "HAVE_ANALYZER: $HAVE_ANALYZER" | tee -a "$TEST_RESULTS"
|
2018-02-21 09:23:46 +00:00
|
|
|
echo "HAVE_REPTOLINE: $HAVE_REPTOLINE" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
echo "HAVE_VALGRIND: $HAVE_VALGRIND" | tee -a "$TEST_RESULTS"
|
2018-02-21 09:23:46 +00:00
|
|
|
# HAVE_REPTOLINE is for Meltdown and Spectre option testing, called Reptoline (play on trampoline)
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_INTEL_MULTIARCH" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "HAVE_INTEL_MULTIARCH: $HAVE_INTEL_MULTIARCH" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_PPC_MULTIARCH" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "HAVE_PPC_MULTIARCH: $HAVE_PPC_MULTIARCH" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
|
|
|
|
# CPU is logical count, memory is in MiB. Low resource boards have
|
|
|
|
# fewer than 4 cores and 1GB or less memory. We use this to
|
|
|
|
# determine if we can build in parallel without an OOM kill.
|
|
|
|
CPU_COUNT=1
|
|
|
|
MEM_SIZE=512
|
|
|
|
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_SPARC" -ne 0) && ("$IS_LINUX" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
CPU_COUNT="$($GREP -E 'CPU.*' /proc/cpuinfo | cut -f 1 -d ':' | $SED 's|CPU||g' | sort -n | tail -1)"
|
|
|
|
MEM_SIZE="$($GREP "MemTotal" < /proc/meminfo | $AWK '{print int($2/1024)}')"
|
2018-03-09 01:14:37 +00:00
|
|
|
elif [[ (-e "/proc/cpuinfo") && (-e "/proc/meminfo") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
CPU_COUNT="$($GREP -c -E "^processor" < /proc/cpuinfo)"
|
|
|
|
MEM_SIZE="$($GREP "MemTotal" < /proc/meminfo | $AWK '{print int($2/1024)}')"
|
2019-08-11 18:54:14 +00:00
|
|
|
elif [[ "$IS_DARWIN" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
CPU_COUNT="$(sysctl -a 2>&1 | $GREP "hw.availcpu" | $AWK '{print $3; exit}')"
|
|
|
|
MEM_SIZE="$(sysctl -a 2>&1 | $GREP "hw.memsize" | $AWK '{print int($3/1024/1024); exit;}')"
|
2019-08-11 18:54:14 +00:00
|
|
|
elif [[ "$IS_SOLARIS" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
CPU_COUNT="$(psrinfo 2>/dev/null | wc -l | $AWK '{print $1}')"
|
|
|
|
MEM_SIZE="$(prtconf 2>/dev/null | $GREP "Memory" | $AWK '{print int($3)}')"
|
2019-08-11 18:54:14 +00:00
|
|
|
elif [[ "$IS_AIX" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
CPU_COUNT="$(bindprocessor -q 2>/dev/null | cut -f 2 -d ":" | wc -w | $AWK '{print $1}')"
|
|
|
|
MEM_SIZE="$(prtconf -m 2>/dev/null | $GREP "MB" | $AWK '{print int($3); exit;}')"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Benchmarks expect frequency in GiHz.
|
|
|
|
CPU_FREQ=0.5
|
|
|
|
if [[ (-e "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
CPU_FREQ="$(cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq)"
|
|
|
|
CPU_FREQ="$(echo "$CPU_FREQ" | $AWK '{print $0/1024/1024; exit}')"
|
2016-09-23 15:32:14 +00:00
|
|
|
elif [[ (-e "/proc/cpuinfo") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
CPU_FREQ="$($GREP 'MHz' < /proc/cpuinfo | $AWK '{print $4; exit}')"
|
|
|
|
if [[ -z "$CPU_FREQ" ]]; then CPU_FREQ=512; fi
|
|
|
|
CPU_FREQ="$(echo "$CPU_FREQ" | $AWK '{print $0/1024}')"
|
2019-08-11 18:54:14 +00:00
|
|
|
elif [[ "$IS_DARWIN" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
CPU_FREQ="$(sysctl -a 2>&1 | $GREP "hw.cpufrequency" | $AWK '{print int($3); exit;}')"
|
|
|
|
CPU_FREQ="$(echo "$CPU_FREQ" | $AWK '{print int($0/1024/1024/1024)}')"
|
2019-08-11 18:54:14 +00:00
|
|
|
elif [[ "$IS_SOLARIS" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
CPU_FREQ="$(psrinfo -v 2>/dev/null | $GREP "MHz" | $AWK '{print $6; exit;}')"
|
|
|
|
CPU_FREQ="$(echo "$CPU_FREQ" | $AWK '{print $0/1024}')"
|
2019-08-11 18:54:14 +00:00
|
|
|
elif [[ "$IS_AIX" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
CPU_FREQ="$(prtconf -s 2>/dev/null | $GREP "MHz" | $AWK '{print $4; exit;}')"
|
|
|
|
CPU_FREQ="$(echo "$CPU_FREQ" | $AWK '{print $0/1024}')"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2019-10-13 10:42:20 +00:00
|
|
|
# Fixups for later versions of OS X
|
|
|
|
if [[ "$IS_DARWIN" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ (-z "$CPU_COUNT") || ("$CPU_COUNT" -eq 0) ]]; then
|
|
|
|
CPU_COUNT="$(sysctl -a 2>&1 | $GREP "hw.activecpu" | $AWK '{print $2; exit}')"
|
|
|
|
fi
|
|
|
|
if [[ (-z "$MEM_SIZE") || ("$MEM_SIZE" -eq 0) ]]; then
|
|
|
|
MEM_SIZE="$(sysctl -a 2>&1 | $GREP "hw.memsize" | $AWK '{print int($2/1024/1024); exit;}')"
|
|
|
|
fi
|
|
|
|
if [[ (-z "$CPU_FREQ") || ("$CPU_FREQ" -eq 0) ]]; then
|
|
|
|
CPU_FREQ="$(sysctl -a 2>&1 | $GREP "hw.cpufrequency" | $AWK '{print int($2); exit;}')"
|
|
|
|
CPU_FREQ="$(echo "$CPU_FREQ" | $AWK '{print int($0/1024/1024/1024)}')"
|
|
|
|
fi
|
2021-03-09 00:15:13 +00:00
|
|
|
if [[ (-z "$CPU_FREQ") || ("$CPU_FREQ" -eq 0) ]]; then
|
|
|
|
CPU_FREQ="$(sysctl -a 2>&1 | $GREP "hw.tbfrequency" | $AWK '{print int($2); exit;}')"
|
|
|
|
CPU_FREQ="$(echo "$CPU_FREQ" | $AWK '{print int($0/10/1024/1024)}')"
|
|
|
|
fi
|
2019-10-13 10:42:20 +00:00
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
# Some ARM devboards cannot use 'make -j N', even with multiple cores and RAM
|
|
|
|
# An 8-core Cubietruck Plus with 2GB RAM experiences OOM kills with '-j 2'.
|
|
|
|
HAVE_SWAP=1
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$IS_LINUX" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
# If memory is small, then ensure swap space exists
|
|
|
|
if [[ "$MEM_SIZE" -lt 4096 ]]; then
|
|
|
|
if [[ (-e "/proc/meminfo") ]]; then
|
|
|
|
SWAP_SIZE="$($GREP 'SwapTotal' < /proc/meminfo | "$AWK" '{print $2}')"
|
|
|
|
if [[ "$SWAP_SIZE" -eq 0 ]]; then
|
|
|
|
HAVE_SWAP=0
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
HAVE_SWAP=0
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-07 17:16:26 +00:00
|
|
|
echo "" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
echo "CPU: $CPU_COUNT logical" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "FREQ: $CPU_FREQ GHz" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "MEM: $MEM_SIZE MB" | tee -a "$TEST_RESULTS"
|
|
|
|
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$CPU_COUNT" -ge 2 && "$MEM_SIZE" -ge 1280 && "$HAVE_SWAP" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$WANT_NICE" -eq 1) ]]; then
|
|
|
|
CPU_COUNT=$(echo -n "$CPU_COUNT 2" | "$AWK" '{print int($1/$2)}')
|
|
|
|
fi
|
|
|
|
MAKEARGS=(-j "$CPU_COUNT")
|
|
|
|
echo "Using $MAKE -j $CPU_COUNT"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
|
|
|
|
GIT_REPO=$(git branch 2>&1 | "$GREP" -v "fatal" | wc -l | "$AWK" '{print $1; exit;}')
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$GIT_REPO" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
|
|
|
GIT_HASH=$(git rev-parse HEAD 2>/dev/null | cut -c 1-16)
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-07 17:16:26 +00:00
|
|
|
echo "" | tee -a "$TEST_RESULTS"
|
2020-05-09 21:55:44 +00:00
|
|
|
if [[ -n "$GIT_BRANCH" ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "Git branch: $GIT_BRANCH (commit $GIT_HASH)" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$SUN_COMPILER" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
"$CXX" -V 2>&1 | "$SED" 's|CC:|Compiler:|g' | head -1 | tee -a "$TEST_RESULTS"
|
2019-08-11 18:54:14 +00:00
|
|
|
elif [[ ("$XLC_COMPILER" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "Compiler: $($CXX -qversion | head -1)" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
else
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "Compiler: $($CXX --version | head -1)" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2017-10-16 10:39:50 +00:00
|
|
|
CXX_PATH=$(command -v "$CXX" 2>/dev/null)
|
2016-09-23 15:32:14 +00:00
|
|
|
CXX_SYMLINK=$(ls -l "$CXX_PATH" 2>/dev/null | "$GREP" -c '\->' | "$AWK" '{print $1}')
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$CXX_SYMLINK" -ne 0) ]]; then CXX_PATH="$CXX_PATH (symlinked)"; fi
|
2016-09-23 15:32:14 +00:00
|
|
|
echo "Pathname: $CXX_PATH" | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
############################################
|
|
|
|
|
2016-12-27 17:34:57 +00:00
|
|
|
# Calculate these once. They handle Clang, GCC, ICC, etc
|
2016-09-23 15:32:14 +00:00
|
|
|
DEBUG_CXXFLAGS="-DDEBUG $OPT_G3 $OPT_O0"
|
2017-08-30 12:32:20 +00:00
|
|
|
RELEASE_CXXFLAGS="-DNDEBUG $OPT_G2 $OPT_O3"
|
2016-09-23 15:32:14 +00:00
|
|
|
VALGRIND_CXXFLAGS="-DNDEBUG $OPT_G3 $OPT_O1"
|
2017-01-27 11:31:55 +00:00
|
|
|
WARNING_CXXFLAGS=()
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$GCC_COMPILER" -ne 0 || "$CLANG_COMPILER" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
WARNING_CXXFLAGS+=("-Wall" "-Wextra" "-Wno-unknown-pragmas" "-Wstrict-overflow")
|
|
|
|
WARNING_CXXFLAGS+=("-Wcast-align" "-Wwrite-strings" "-Wformat=2" "-Wformat-security")
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2018-08-22 14:12:24 +00:00
|
|
|
# On PowerPC we test the original Altivec load and store with unaligned data.
|
|
|
|
# Modern compilers generate a warning and recommend the new loads and stores.
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$GCC_COMPILER" -ne 0 && ("$IS_PPC32" -ne 0 || "$IS_PPC64" -ne 0) ) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
WARNING_CXXFLAGS+=("-Wno-deprecated")
|
2018-08-22 14:12:24 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-07 17:16:26 +00:00
|
|
|
echo "" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
echo "DEBUG_CXXFLAGS: $DEBUG_CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "RELEASE_CXXFLAGS: $RELEASE_CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "VALGRIND_CXXFLAGS: $VALGRIND_CXXFLAGS" | tee -a "$TEST_RESULTS"
|
2020-05-09 21:55:44 +00:00
|
|
|
if [[ (-n "$USER_CXXFLAGS") ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "USER_CXXFLAGS: $USER_CXXFLAGS" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
#############################################
|
|
|
|
#############################################
|
|
|
|
############### BEGIN TESTING ###############
|
|
|
|
#############################################
|
|
|
|
#############################################
|
|
|
|
|
|
|
|
TEST_BEGIN=$(date)
|
2021-02-07 17:16:26 +00:00
|
|
|
echo "" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
echo "Start time: $TEST_BEGIN" | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Posix NDEBUG and assert
|
|
|
|
if true; then
|
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: No Posix NDEBUG or assert" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("No Posix NDEBUG or assert")
|
|
|
|
FAILED=0
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
# Search for headers. Filter out C++ abd Doxygen comments.
|
|
|
|
COUNT=$(cat ./*.h ./*.cpp | "$GREP" -v '//' | "$GREP" -c -E '(assert.h|cassert)')
|
|
|
|
if [[ "$COUNT" -ne 0 ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "FAILED: found Posix assert headers" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
# Search for asserts. Filter out C++, Doxygen comments and static_assert.
|
|
|
|
COUNT=$(cat ./*.h ./*.cpp | "$GREP" -v -E '//|_assert' | "$GREP" -c -E 'assert[[:space:]]*\(')
|
|
|
|
if [[ "$COUNT" -ne 0 ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "FAILED: found use of Posix assert" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
# Filter out C++ and Doxygen comments.
|
|
|
|
COUNT=$(cat ./*.h ./*.cpp | "$GREP" -v '//' | "$GREP" -c 'NDEBUG')
|
|
|
|
if [[ "$COUNT" -ne 0 ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "FAILED: found use of Posix NDEBUG" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$FAILED" -eq 0) ]]; then
|
|
|
|
echo "Verified no Posix NDEBUG or assert" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# C++ std::min and std::max
|
|
|
|
# This is due to Windows.h and NOMINMAX. Linux test fine, while Windows breaks.
|
|
|
|
if true; then
|
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: C++ std::min and std::max" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("C++ std::min and std::max")
|
|
|
|
FAILED=0
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
# If this fires, then use the library's STDMIN(a,b) or (std::min)(a, b);
|
|
|
|
COUNT=$(cat ./*.h ./*.cpp | "$GREP" -v '//' | "$GREP" -c -E 'std::min[[:space:]]*\(')
|
|
|
|
if [[ "$COUNT" -ne 0 ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "FAILED: found std::min" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
# If this fires, then use the library's STDMAX(a,b) or (std::max)(a, b);
|
|
|
|
COUNT=$(cat ./*.h ./*.cpp | "$GREP" -v '//' | "$GREP" -c -E 'std::max[[:space:]]*\(')
|
|
|
|
if [[ "$COUNT" -ne 0 ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "FAILED: found std::max" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$FAILED" -eq 0) ]]; then
|
|
|
|
echo "Verified std::min and std::max" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# X86 code generation tests
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_DISASS" -ne 0 && ("$IS_X86" -ne 0 || "$IS_X64" -ne 0)) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# X86 rotate immediate code generation
|
|
|
|
|
|
|
|
X86_ROTATE_IMM=1
|
|
|
|
if [[ ("$X86_ROTATE_IMM" -ne 0) ]]; then
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: X86 rotate immediate code generation" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("X86 rotate immediate code generation")
|
|
|
|
|
|
|
|
OBJFILE=sha.o; rm -f "$OBJFILE" 2>/dev/null
|
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
DISASS_TEXT=$("$DISASS" "${DISASSARGS[@]}" "$OBJFILE" 2>/dev/null)
|
|
|
|
|
|
|
|
X86_SSE2=$(echo -n "$X86_CPU_FLAGS" | "$GREP" -i -c sse2)
|
|
|
|
X86_SHA256_HASH_BLOCKS=$(echo -n "$DISASS_TEXT" | "$GREP" -c 'SHA256_HashMultipleBlocks_SSE2')
|
|
|
|
if [[ ("$X86_SHA256_HASH_BLOCKS" -ne 0) ]]; then
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c -E '(rol.*0x|ror.*0x)')
|
|
|
|
if [[ ("$COUNT" -le 250) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate rotate immediate instruction (SHA256_HashMultipleBlocks_SSE2)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c -E '(rol.*0x|ror.*0x)')
|
|
|
|
if [[ ("$COUNT" -le 500) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate rotate immediate instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$X86_SSE2" -ne 0 && "$X86_SHA256_HASH_BLOCKS" -eq 0) ]]; then
|
|
|
|
echo "ERROR: failed to use SHA256_HashMultipleBlocks_SSE2" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$FAILED" -eq 0 && "$X86_SHA256_HASH_BLOCKS" -ne 0) ]]; then
|
|
|
|
echo "Verified rotate immediate machine instructions (SHA256_HashMultipleBlocks_SSE2)" | tee -a "$TEST_RESULTS"
|
|
|
|
elif [[ ("$FAILED" -eq 0) ]]; then
|
|
|
|
echo "Verified rotate immediate machine instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Test CRC-32C code generation
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -msse4.2 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
X86_CRC32=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$X86_CRC32" -ne 0) ]]; then
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: X86 CRC32 code generation" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("X86 CRC32 code generation")
|
|
|
|
|
|
|
|
OBJFILE=crc_simd.o; rm -f "$OBJFILE" 2>/dev/null
|
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
COUNT=0
|
|
|
|
FAILED=0
|
|
|
|
DISASS_TEXT=$("$DISASS" "${DISASSARGS[@]}" "$OBJFILE" 2>/dev/null)
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c crc32b)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate crc32b instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c crc32l)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate crc32l instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$FAILED" -eq 0) ]]; then
|
|
|
|
echo "Verified crc32b and crc32l machine instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Test AES-NI code generation
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -maes "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
X86_AESNI=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$X86_AESNI" -ne 0) ]]; then
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: X86 AES-NI code generation" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("X86 AES-NI code generation")
|
|
|
|
|
|
|
|
OBJFILE=rijndael_simd.o; rm -f "$OBJFILE" 2>/dev/null
|
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
COUNT=0
|
|
|
|
FAILED=0
|
|
|
|
DISASS_TEXT=$("$DISASS" "${DISASSARGS[@]}" "$OBJFILE" 2>/dev/null)
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c aesenc)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate aesenc instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c aesenclast)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate aesenclast instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c aesdec)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate aesdec instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c aesdeclast)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate aesdeclast instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c aesimc)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate aesimc instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c aeskeygenassist)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate aeskeygenassist instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$FAILED" -eq 0) ]]; then
|
|
|
|
echo "Verified aesenc, aesenclast, aesdec, aesdeclast, aesimc, aeskeygenassist machine instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# X86 carryless multiply code generation
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -mpclmul "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
X86_PCLMUL=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$X86_PCLMUL" -ne 0) ]]; then
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: X86 carryless multiply code generation" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("X86 carryless multiply code generation")
|
|
|
|
|
|
|
|
OBJFILE=gcm_simd.o; rm -f "$OBJFILE" 2>/dev/null
|
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
COUNT=0
|
|
|
|
FAILED=0
|
|
|
|
DISASS_TEXT=$("$DISASS" "${DISASSARGS[@]}" "$OBJFILE" 2>/dev/null)
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c -E '(pclmulqdq|pclmullqhq|vpclmulqdq)')
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate pclmullqhq instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c -E '(pclmulqdq|pclmullqlq|vpclmulqdq)')
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate pclmullqlq instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$FAILED" -eq 0) ]]; then
|
|
|
|
echo "Verified pclmullqhq and pclmullqlq machine instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Test RDRAND and RDSEED code generation
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -mrdrnd "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
X86_RDRAND=1
|
|
|
|
fi
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -mrdseed "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
X86_RDSEED=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$X86_RDRAND" -ne 0 || "$X86_RDSEED" -ne 0) ]]; then
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: X86 RDRAND and RDSEED code generation" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("X86 RDRAND and RDSEED code generation")
|
|
|
|
|
|
|
|
OBJFILE=rdrand.o; rm -f "$OBJFILE" 2>/dev/null
|
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
COUNT=0
|
|
|
|
FAILED=0
|
|
|
|
DISASS_TEXT=$("$DISASS" "${DISASSARGS[@]}" "$OBJFILE" 2>/dev/null)
|
|
|
|
|
|
|
|
if [[ "$X86_RDRAND" -ne 0 ]]; then
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c rdrand)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate rdrand instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$X86_RDSEED" -ne 0 ]]; then
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c rdseed)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate rdseed instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$FAILED" -eq 0) ]]; then
|
|
|
|
echo "Verified rdrand and rdseed machine instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# X86 SHA code generation
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -msha "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
X86_SHA=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$X86_SHA" -ne 0) ]]; then
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: X86 SHA code generation" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("X86 SHA code generation")
|
|
|
|
|
|
|
|
OBJFILE=sha_simd.o; rm -f "$OBJFILE" 2>/dev/null
|
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
COUNT=0
|
|
|
|
FAILED=0
|
|
|
|
DISASS_TEXT=$("$DISASS" "${DISASSARGS[@]}" "$OBJFILE" 2>/dev/null)
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c sha1rnds4)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate sha1rnds4 instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c sha1nexte)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate sha1nexte instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c sha1msg1)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate sha1msg1 instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c sha1msg2)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate sha1msg2 instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c sha256rnds2)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate sha256rnds2 instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c sha256msg1)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate sha256msg1 instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c sha256msg2)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate sha256msg2 instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$FAILED" -eq 0) ]]; then
|
|
|
|
echo "Verified sha1rnds4, sha1nexte, sha1msg1, sha1msg2, sha256rnds2, sha256msg1 and sha256msg2 machine instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# ARM code generation tests
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_DISASS" -ne 0 && ("$IS_ARM32" -ne 0 || "$IS_ARM64" -ne 0)) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# ARM NEON code generation
|
|
|
|
|
|
|
|
ARM_NEON=$(echo -n "$ARM_CPU_FLAGS" | "$GREP" -i -c -E '(neon|asimd)')
|
|
|
|
if [[ ("$ARM_NEON" -ne 0 || "$HAVE_ARM_NEON" -ne 0) ]]; then
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: ARM NEON code generation" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("ARM NEON code generation")
|
|
|
|
|
|
|
|
OBJFILE=aria_simd.o; rm -f "$OBJFILE" 2>/dev/null
|
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
COUNT=0
|
|
|
|
FAILED=0
|
|
|
|
DISASS_TEXT=$("$DISASS" "${DISASSARGS[@]}" "$OBJFILE" 2>/dev/null)
|
|
|
|
|
2021-03-09 03:14:07 +00:00
|
|
|
if [[ ("$HAVE_ARMV8" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
# ARIA::UncheckedKeySet: 4 ldr q{N}
|
2021-03-21 09:36:08 +00:00
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c -E 'ldr[[:space:]]*q|ldp[[:space:]]*q')
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$COUNT" -lt 4) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate NEON load instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
else # ARMv7
|
|
|
|
# ARIA::UncheckedKeySet: 4 vld1.32 {d1,d2}
|
2021-03-21 09:36:08 +00:00
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c -E 'vld1.32[[:space:]]*')
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$COUNT" -lt 4) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate NEON load instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-03-09 03:14:07 +00:00
|
|
|
if [[ ("$HAVE_ARMV8" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
# ARIA::UncheckedKeySet: 17 str q{N}
|
2021-03-21 09:36:08 +00:00
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c -E 'str[[:space:]]*q|stp[[:space:]]*q')
|
|
|
|
if [[ ("$COUNT" -lt 8) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate NEON store instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
# ARIA::UncheckedKeySet: 17 vstr1.32 {d1,d2}
|
2021-03-21 09:36:08 +00:00
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c -E 'vst1.32[[:space:]]*')
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$COUNT" -lt 16) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate NEON store instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-03-09 03:14:07 +00:00
|
|
|
if [[ ("$HAVE_ARMV8" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
# ARIA::UncheckedKeySet: 17 shl v{N}
|
2021-03-21 09:36:08 +00:00
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c -E 'shl[[:space:]]*v|shl.4s')
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$COUNT" -lt 16) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate NEON shift left instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
# ARIA::UncheckedKeySet: 17 vshl
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c -E 'vshl')
|
|
|
|
if [[ ("$COUNT" -lt 16) ]]; then
|
|
|
|
FAILED=1
|
2021-03-08 06:41:40 +00:00
|
|
|
echo "ERROR: failed to generate NEON shift left instructions" | tee -a "$TEST_RESULTS"
|
2020-05-10 03:16:29 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-03-09 03:14:07 +00:00
|
|
|
if [[ ("$HAVE_ARMV8" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
# ARIA::UncheckedKeySet: 17 shr v{N}
|
2021-03-21 09:36:08 +00:00
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c -E 'shr[[:space:]]*v|shr.4s')
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$COUNT" -lt 16) ]]; then
|
|
|
|
FAILED=1
|
2021-03-08 06:41:40 +00:00
|
|
|
echo "ERROR: failed to generate NEON shift right instructions" | tee -a "$TEST_RESULTS"
|
2020-05-10 03:16:29 +00:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
# ARIA::UncheckedKeySet: 17 vshr
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c -E 'vshr')
|
|
|
|
if [[ ("$COUNT" -lt 16) ]]; then
|
|
|
|
FAILED=1
|
2021-03-08 06:41:40 +00:00
|
|
|
echo "ERROR: failed to generate NEON shift right instructions" | tee -a "$TEST_RESULTS"
|
2020-05-10 03:16:29 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-03-09 03:14:07 +00:00
|
|
|
if [[ ("$HAVE_ARMV8" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
# ARIA::UncheckedKeySet: 12 ext v{N}
|
2021-03-21 09:36:08 +00:00
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c -E 'ext[[:space:]]*v|ext.*v')
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("$COUNT" -lt 12) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate NEON extract instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# ARIA::UncheckedKeySet: 17 veor
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c -E 'eor.*v|veor')
|
|
|
|
if [[ ("$COUNT" -lt 16) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate NEON xor instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$FAILED" -eq 0) ]]; then
|
|
|
|
echo "Verified NEON load, store, shfit left, shift right, xor machine instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# ARM CRC32 code generation
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -march=armv8-a+crc "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
ARM_CRC32=1
|
|
|
|
fi
|
|
|
|
|
2021-03-09 03:14:07 +00:00
|
|
|
if [[ ("$HAVE_ARMV8" -ne 0 && "$ARM_CRC32" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: ARM CRC32 code generation" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("ARM CRC32 code generation")
|
|
|
|
|
|
|
|
OBJFILE=crc_simd.o; rm -f "$OBJFILE" 2>/dev/null
|
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
COUNT=0
|
|
|
|
FAILED=0
|
|
|
|
DISASS_TEXT=$("$DISASS" "${DISASSARGS[@]}" "$OBJFILE" 2>/dev/null)
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c crc32cb)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate crc32cb instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c crc32cw)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate crc32cw instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c crc32b)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate crc32b instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c crc32w)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate crc32w instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$FAILED" -eq 0) ]]; then
|
|
|
|
echo "Verified crc32cb, crc32cw, crc32b and crc32w machine instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# ARM carryless multiply code generation
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -march=armv8-a+crypto "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
ARM_PMULL=1
|
|
|
|
fi
|
|
|
|
|
2021-03-09 03:14:07 +00:00
|
|
|
if [[ ("$HAVE_ARMV8" -ne 0 && "$ARM_PMULL" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: ARM carryless multiply code generation" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("ARM carryless multiply code generation")
|
|
|
|
|
|
|
|
OBJFILE=gcm_simd.o; rm -f "$OBJFILE" 2>/dev/null
|
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
COUNT=0
|
|
|
|
FAILED=0
|
|
|
|
DISASS_TEXT=$("$DISASS" "${DISASSARGS[@]}" "$OBJFILE" 2>/dev/null)
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -v pmull2 | "$GREP" -i -c pmull)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate pmull instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c pmull2)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate pmull2 instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$FAILED" -eq 0) ]]; then
|
|
|
|
echo "Verified pmull and pmull2 machine instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# ARM AES code generation
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -march=armv8-a+crypto "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
ARM_AES=1
|
|
|
|
fi
|
|
|
|
|
2021-03-09 03:14:07 +00:00
|
|
|
if [[ ("$HAVE_ARMV8" -ne 0 && "$ARM_AES" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
2021-03-08 06:49:18 +00:00
|
|
|
echo "Testing: ARM AES code generation" | tee -a "$TEST_RESULTS"
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
|
2021-03-08 06:49:18 +00:00
|
|
|
TEST_LIST+=("ARM AES code generation")
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
OBJFILE=rijndael_simd.o; rm -f "$OBJFILE" 2>/dev/null
|
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
COUNT=0
|
|
|
|
FAILED=0
|
|
|
|
DISASS_TEXT=$("$DISASS" "${DISASSARGS[@]}" "$OBJFILE" 2>/dev/null)
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c aese)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate aese instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c aesmc)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate aesmc instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c aesd)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate aesd instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c aesimc)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate aesimc instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$FAILED" -eq 0) ]]; then
|
|
|
|
echo "Verified aese, aesd, aesmc, aesimc machine instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# ARM SHA code generation
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -march=armv8-a+crypto "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
2021-03-08 06:47:21 +00:00
|
|
|
ARM_SHA1=1
|
|
|
|
ARM_SHA2=1
|
2020-05-10 03:16:29 +00:00
|
|
|
fi
|
|
|
|
|
2021-03-09 03:14:07 +00:00
|
|
|
if [[ ("$HAVE_ARMV8" -ne 0 && "$ARM_SHA1" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
2021-03-08 06:49:18 +00:00
|
|
|
echo "Testing: ARM SHA1 code generation" | tee -a "$TEST_RESULTS"
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
|
2021-03-08 06:49:18 +00:00
|
|
|
TEST_LIST+=("ARM SHA1 code generation")
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
OBJFILE=sha_simd.o; rm -f "$OBJFILE" 2>/dev/null
|
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
COUNT=0
|
|
|
|
FAILED=0
|
|
|
|
DISASS_TEXT=$("$DISASS" "${DISASSARGS[@]}" "$OBJFILE" 2>/dev/null)
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c sha1c)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate sha1c instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c sha1m)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate sha1m instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c sha1p)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate sha1p instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c sha1h)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate sha1h instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c sha1su0)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate sha1su0 instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c sha1su1)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate sha1su1 instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
2021-03-08 06:47:21 +00:00
|
|
|
if [[ ("$FAILED" -eq 0) ]]; then
|
|
|
|
echo "Verified sha1c, sha1m, sha1p, sha1su0, sha1su1 machine instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2021-03-09 03:14:07 +00:00
|
|
|
if [[ ("$HAVE_ARMV8" -ne 0 && "$ARM_SHA2" -ne 0) ]]; then
|
2021-03-08 06:47:21 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
2021-03-08 06:49:18 +00:00
|
|
|
echo "Testing: ARM SHA2 code generation" | tee -a "$TEST_RESULTS"
|
2021-03-08 06:47:21 +00:00
|
|
|
echo
|
|
|
|
|
2021-03-08 06:49:18 +00:00
|
|
|
TEST_LIST+=("ARM SHA2 code generation")
|
2021-03-08 06:47:21 +00:00
|
|
|
|
|
|
|
OBJFILE=sha_simd.o; rm -f "$OBJFILE" 2>/dev/null
|
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
COUNT=0
|
|
|
|
FAILED=0
|
|
|
|
DISASS_TEXT=$("$DISASS" "${DISASSARGS[@]}" "$OBJFILE" 2>/dev/null)
|
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -v sha256h2 | "$GREP" -i -c sha256h)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate sha256h instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c sha256h2)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate sha256h2 instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c sha256su0)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate sha256su0 instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c sha256su1)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate sha256su1 instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$FAILED" -eq 0) ]]; then
|
2021-03-08 06:47:21 +00:00
|
|
|
echo "Verified sha256h, sha256h2, sha256su0, sha256su1 machine instructions" | tee -a "$TEST_RESULTS"
|
2020-05-10 03:16:29 +00:00
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2017-09-09 18:56:47 +00:00
|
|
|
############################################
|
|
|
|
# Power8 code generation tests
|
2020-05-11 19:22:20 +00:00
|
|
|
if [[ ("$HAVE_DISASS" -ne 0 && "$GCC_4_8_OR_ABOVE" -ne 0 && ("$IS_PPC32" -ne 0 || "$IS_PPC64" -ne 0)) ]]; then
|
2017-09-09 18:56:47 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Power8 AES
|
|
|
|
|
|
|
|
PPC_AES=0
|
|
|
|
if [[ ("$PPC_AES" -eq 0) ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -mcpu=power8 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
PPC_AES=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ ("$PPC_AES" -eq 0) ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -qarch=pwr8 -qaltivec "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
PPC_AES=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$PPC_AES" -ne 0) ]]; then
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
2021-03-08 06:49:18 +00:00
|
|
|
echo "Testing: Power8 AES code generation" | tee -a "$TEST_RESULTS"
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
|
2021-03-08 06:49:18 +00:00
|
|
|
TEST_LIST+=("Power8 AES code generation")
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
OBJFILE=rijndael_simd.o; rm -f "$OBJFILE" 2>/dev/null
|
2021-03-09 01:13:23 +00:00
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
COUNT=0
|
|
|
|
FAILED=0
|
|
|
|
DISASS_TEXT=$("$DISASS" "${DISASSARGS[@]}" "$OBJFILE" 2>/dev/null)
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -v vcipherlast | "$GREP" -i -c vcipher)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate vcipher instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c vcipherlast)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate vcipherlast instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -v vncipherlast | "$GREP" -i -c vncipher)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate vncipher instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c vncipherlast)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate vncipherlast instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$FAILED" -eq 0) ]]; then
|
2021-03-09 01:24:28 +00:00
|
|
|
echo "Verified vcipher, vcipherlast, vncipher, vncipherlast machine instructions" | tee -a "$TEST_RESULTS"
|
2020-05-10 03:16:29 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Power8 SHA
|
|
|
|
|
|
|
|
PPC_SHA=0
|
|
|
|
if [[ ("$PPC_SHA" -eq 0) ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -mcpu=power8 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
PPC_SHA=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ ("$PPC_SHA" -eq 0) ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -qarch=pwr8 -qaltivec "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
PPC_SHA=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$PPC_SHA" -ne 0) ]]; then
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
2021-03-08 06:49:18 +00:00
|
|
|
echo "Testing: Power8 SHA code generation" | tee -a "$TEST_RESULTS"
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
|
2021-03-08 06:49:18 +00:00
|
|
|
TEST_LIST+=("Power8 SHA code generation")
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
OBJFILE=sha_simd.o; rm -f "$OBJFILE" 2>/dev/null
|
2021-03-09 01:13:23 +00:00
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
COUNT=0
|
|
|
|
FAILED=0
|
|
|
|
DISASS_TEXT=$("$DISASS" "${DISASSARGS[@]}" "$OBJFILE" 2>/dev/null)
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c vshasigmaw)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate vshasigmaw instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c vshasigmad)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate vshasigmad instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$FAILED" -eq 0) ]]; then
|
|
|
|
echo "Verified vshasigmaw and vshasigmad machine instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Power8 VMULL
|
|
|
|
|
|
|
|
PPC_VMULL=0
|
|
|
|
if [[ ("$PPC_VMULL" -eq 0) ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -mcpu=power8 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
PPC_VMULL=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ ("$PPC_VMULL" -eq 0) ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CXX" -qarch=pwr8 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
PPC_VMULL=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$PPC_VMULL" -ne 0) ]]; then
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
2021-03-08 06:49:18 +00:00
|
|
|
echo "Testing: Power8 carryless multiply code generation" | tee -a "$TEST_RESULTS"
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
|
2021-03-08 06:49:18 +00:00
|
|
|
TEST_LIST+=("Power8 carryless multiply code generation")
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
OBJFILE=gcm_simd.o; rm -f "$OBJFILE" 2>/dev/null
|
2021-03-09 01:13:23 +00:00
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
COUNT=0
|
|
|
|
FAILED=0
|
|
|
|
DISASS_TEXT=$("$DISASS" "${DISASSARGS[@]}" "$OBJFILE" 2>/dev/null)
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c vpmsum)
|
|
|
|
if [[ ("$COUNT" -eq 0) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate vpmsum instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$FAILED" -eq 0) ]]; then
|
|
|
|
echo "Verified vpmsum machine instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2021-03-22 02:29:39 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Altivec generation tests
|
|
|
|
if [[ ("$HAVE_DISASS" -ne 0 && ("$IS_PPC32" -ne 0 || "$IS_PPC64" -ne 0)) ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Altivec
|
|
|
|
|
|
|
|
PPC_ALTIVEC=0
|
|
|
|
if [[ ("$PPC_ALTIVEC" -eq 0) ]]; then
|
|
|
|
"$CXX" -maltivec "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
PPC_ALTIVEC=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ ("$PPC_ALTIVEC" -eq 0) ]]; then
|
|
|
|
"$CXX" -qarch=altivec "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
PPC_ALTIVEC=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$PPC_ALTIVEC" -ne 0) ]]; then
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Altivec code generation" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Altivec code generation")
|
|
|
|
|
|
|
|
OBJFILE=speck128_simd.o; rm -f "$OBJFILE" 2>/dev/null
|
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
COUNT=0
|
|
|
|
FAILED=0
|
|
|
|
DISASS_TEXT=$("$DISASS" "${DISASSARGS[@]}" "$OBJFILE" 2>/dev/null)
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c lvx)
|
|
|
|
if [[ ("$COUNT" -lt 8) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate lvx instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c stvx)
|
|
|
|
if [[ ("$COUNT" -lt 8) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate stvx instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c vsldoi)
|
|
|
|
if [[ ("$COUNT" -lt 8) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate vsldoi instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c vxor)
|
|
|
|
if [[ ("$COUNT" -lt 8) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate vxor instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c vperm)
|
|
|
|
if [[ ("$COUNT" -lt 8) ]]; then
|
|
|
|
FAILED=1
|
|
|
|
echo "ERROR: failed to generate vperm instruction" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ("$FAILED" -eq 0) ]]; then
|
|
|
|
echo "Verified vxl, stvx, vsldoi, vxor, vperm instructions" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2017-09-09 18:56:47 +00:00
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
############################################
|
|
|
|
# Default CXXFLAGS
|
|
|
|
if true; then
|
2021-03-20 01:02:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, default CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, default CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
# Stop now if things are broke
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
# Stop now if things are broke
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
# Stop now if things are broke
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, default CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, default CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
# Stop now if things are broke
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
# Stop now if things are broke
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
# Stop now if things are broke
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2017-11-13 01:32:41 +00:00
|
|
|
############################################
|
|
|
|
# Shared Objects
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_LD_LIBRARY_PATH" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, shared object" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, shared object")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXX="$CXX" CXXFLAGS="$DEBUG_CXXFLAGS" LINK_LIBRARY=libcryptopp.so \
|
|
|
|
"$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
LD_LIBRARY_PATH="." ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
LD_LIBRARY_PATH="." ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, shared object" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, shared object")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" LINK_LIBRARY=libcryptopp.so \
|
|
|
|
"$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
LD_LIBRARY_PATH="." ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
LD_LIBRARY_PATH="." ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
echo
|
|
|
|
fi
|
2017-11-13 01:32:41 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Dynamic Objects on Darwin
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_DYLD_LIBRARY_PATH" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, dynamic library" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, dynamic library")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXX="$CXX" CXXFLAGS="$DEBUG_CXXFLAGS" LINK_LIBRARY=libcryptopp.dylib \
|
|
|
|
"$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
DYLD_LIBRARY_PATH="." ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
DYLD_LIBRARY_PATH="." ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, dynamic library" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, dynamic library")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" LINK_LIBRARY=libcryptopp.dylib \
|
|
|
|
"$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
DYLD_LIBRARY_PATH="." ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
DYLD_LIBRARY_PATH="." ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
echo
|
|
|
|
fi
|
2017-11-13 01:32:41 +00:00
|
|
|
fi
|
|
|
|
|
2017-05-25 04:04:45 +00:00
|
|
|
############################################
|
|
|
|
# Debian specific.
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_DEBIAN" -ne 0 || "$IS_UBUNTU" -ne 0) ]]; then
|
2017-05-25 04:04:45 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
# Flags taken from Debian's build logs
|
|
|
|
# https://buildd.debian.org/status/fetch.php?pkg=libcrypto%2b%2b&arch=i386&ver=5.6.4-6
|
|
|
|
# https://buildd.debian.org/status/fetch.php?pkg=libcrypto%2b%2b&arch=kfreebsd-amd64&ver=5.6.4-6&stamp=1482663138
|
2017-05-25 04:04:45 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
DEBIAN_FLAGS=("-DHAVE_CONFIG_H" "-I." "-Wdate-time" "-D_FORTIFY_SOURCE=2" "-g" "-O2"
|
|
|
|
"-fstack-protector-strong" "-Wformat -Werror=format-security" "-DCRYPTOPP_INIT_PRIORITY=250"
|
|
|
|
"-DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS" "-DNDEBUG" "-fPIC" "-DPIC")
|
2017-05-25 04:04:45 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debian standard build" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2017-05-25 04:04:45 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Debian standard build")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2017-05-25 04:04:45 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXX="g++" "$MAKE" "${MAKEARGS[@]}" CXXFLAGS="${DEBIAN_FLAGS[*]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2017-05-25 04:04:45 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2017-05-25 04:04:45 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Fedora specific.
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_FEDORA" -ne 0) ]]; then
|
2017-05-25 04:04:45 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
# Flags taken from Fedora's build logs
|
|
|
|
# https://kojipkgs.fedoraproject.org//packages/cryptopp/5.6.3/8.fc27/data/logs/i686/build.log
|
|
|
|
# https://kojipkgs.fedoraproject.org//packages/cryptopp/5.6.3/8.fc27/data/logs/x86_64/build.log
|
|
|
|
if [[ ("$IS_X86" -ne 0) ]]; then
|
|
|
|
MARCH_OPT=("-m32" "-march=i686")
|
|
|
|
elif [[ ("$IS_X64" -ne 0) ]]; then
|
|
|
|
MARCH_OPT=("-m64" "-mtune=generic")
|
|
|
|
fi
|
|
|
|
|
|
|
|
FEDORA_FLAGS=("-DHAVE_CONFIG_H" "-I." "-O2" "-g" "-pipe" "-Wall" "-Werror=format-security" "-fPIC" "-DPIC"
|
|
|
|
"-Wp,-D_FORTIFY_SOURCE=2" "-fexceptions" "-fstack-protector-strong" "--param=ssp-buffer-size=4"
|
|
|
|
"-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1" "${MARCH_OPT[@]}" "-fasynchronous-unwind-tables")
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Fedora standard build" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Fedora standard build")
|
|
|
|
|
|
|
|
if [[ ! -f /usr/lib/rpm/redhat/redhat-hardened-cc1 ]]; then
|
|
|
|
echo "ERROR: please install redhat-rpm-config package"
|
|
|
|
else
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXX="g++" "$MAKE" "${MAKEARGS[@]}" CXXFLAGS="${FEDORA_FLAGS[*]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2017-05-25 04:04:45 +00:00
|
|
|
fi
|
|
|
|
|
2019-07-22 19:37:25 +00:00
|
|
|
############################################
|
|
|
|
# openSUSE specific.
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_SUSE" -ne 0) ]]; then
|
2019-07-22 19:37:25 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
# Flags taken from openSUSE's build logs
|
|
|
|
# http://susepaste.org/view//9613298
|
|
|
|
|
|
|
|
SUSE_FLAGS=("-DNDEBUG" "-g" "-O2"
|
|
|
|
"-D_FORTIFY_SOURCE=2"
|
|
|
|
"-funwind-tables"
|
|
|
|
"-fpic" "-fPIC"
|
|
|
|
"-pthread" "-fopenmp")
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -fstack-protector-strong "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
SUSE_FLAGS+=("-fstack-protector-strong")
|
|
|
|
fi
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -fasynchronous-unwind-tables "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
SUSE_FLAGS+=("-fasynchronous-unwind-tables")
|
|
|
|
fi
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -fstack-clash-protection "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
SUSE_FLAGS+=("-fstack-clash-protection")
|
|
|
|
fi
|
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
"$CXX" -flto=6 "$test_prog" -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
SUSE_FLAGS+=("-flto=6")
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: openSUSE standard build" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("openSUSE standard build")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXX="g++" "$MAKE" "${MAKEARGS[@]}" CXXFLAGS="${SUSE_FLAGS[*]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2019-07-22 19:37:25 +00:00
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
############################################
|
|
|
|
# Minimum platform
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$GCC_COMPILER" -ne 0 || "$CLANG_COMPILER" -ne 0 || "$INTEL_COMPILER" -ne 0) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
# i686 (lacks MMX, SSE and SSE2)
|
|
|
|
if [[ "$IS_X86" -ne 0 ]]; then
|
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, i686 minimum arch CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, i686 minimum arch CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -march=i686 $OPT_PIC"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, i686 minimum arch CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, i686 minimum arch CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -march=i686 $OPT_PIC"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# x86_64
|
|
|
|
if [[ "$IS_X64" -ne 0 ]]; then
|
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, x86_64 minimum arch CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, x86_64 minimum arch CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -march=x86-64 $OPT_PIC"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, x86_64 minimum arch CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, x86_64 minimum arch CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -march=x86-64 $OPT_PIC"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2016-10-26 07:10:52 +00:00
|
|
|
############################################
|
2017-04-23 01:22:32 +00:00
|
|
|
# Mismatched arch capabilities
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ( ("$IS_X86" -ne 0 || "$IS_X32" -ne 0 || "$IS_X64" -ne 0) && "$HAVE_NATIVE_ARCH" -ne 0) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
# i686 (lacks MMX, SSE and SSE2)
|
|
|
|
if [[ "$IS_X86" -ne 0 ]]; then
|
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, mismatched arch capabilities" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, mismatched arch capabilities")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -march=i686 $OPT_PIC"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
# The makefile may add -DCRYPTOPP_DISABLE_XXX, so we can't add -march=native
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS $OPT_PIC"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, mismatched arch capabilities" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, mismatched arch capabilities")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -march=i686 $OPT_PIC"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
# The makefile may add -DCRYPTOPP_DISABLE_XXX, so we can't add -march=native
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS $OPT_PIC"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# x86-64
|
|
|
|
if [[ "$IS_X64" -ne 0 ]]; then
|
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, mismatched arch capabilities" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, mismatched arch capabilities")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -march=x86-64 $OPT_PIC"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
# The makefile may add -DCRYPTOPP_DISABLE_XXX, so we can't add -march=native
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS $OPT_PIC"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, mismatched arch capabilities" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, mismatched arch capabilities")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -march=x86-64 $OPT_PIC"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
# The makefile may add -DCRYPTOPP_DISABLE_XXX, so we can't add -march=native
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS $OPT_PIC"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Debug build, DISABLE_ASM
|
|
|
|
if true; then
|
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, DISABLE_ASM" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, DISABLE_ASM")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -DCRYPTOPP_DISABLE_ASM"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, DISABLE_ASM" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, DISABLE_ASM")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -DCRYPTOPP_DISABLE_ASM"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2017-09-20 01:08:37 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Debug build, NO_CPU_FEATURE_PROBES
|
|
|
|
if true; then
|
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, NO_CPU_FEATURE_PROBES" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, NO_CPU_FEATURE_PROBES")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -DCRYPTOPP_NO_CPU_FEATURE_PROBES=1"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, NO_CPU_FEATURE_PROBES" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, NO_CPU_FEATURE_PROBES")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -DCRYPTOPP_NO_CPU_FEATURE_PROBES=1"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# c++03 debug and release build
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_CXX03" -ne 0 ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, c++03" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, c++03")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++03 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++03" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++03")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++03 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# gnu++03 debug and release build
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_GNU03" -ne 0 ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, gnu++03" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, gnu++03")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=gnu++03 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, gnu++03" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, gnu++03")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=gnu++03 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# c++11 debug and release build
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_CXX11" -ne 0 ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, c++11" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, c++11")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++11 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++11" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++11")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++11 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# gnu++11 debug and release build
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_GNU11" -ne 0 ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, gnu++11" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, gnu++11")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=gnu++11 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, gnu++11" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, gnu++11")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=gnu++11 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# c++14 debug and release build
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_CXX14" -ne 0 ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, c++14" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, c++14")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++14 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++14" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++14")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++14 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# gnu++14 debug and release build
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_GNU14" -ne 0 ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, gnu++14" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, gnu++14")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=gnu++14 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, gnu++14" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, gnu++14")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=gnu++14 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# c++17 debug and release build
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_CXX17" -ne 0 ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, c++17" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, c++17")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++17 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++17" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++17")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++17 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# gnu++17 debug and release build
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_GNU17" -ne 0 ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, gnu++17" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, gnu++17")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=gnu++17 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, gnu++17" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, gnu++17")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=gnu++17 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2018-01-06 10:00:24 +00:00
|
|
|
############################################
|
|
|
|
# c++20 debug and release build
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_CXX20" -ne 0 ]]; then
|
2018-01-06 10:00:24 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, c++20" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, c++20")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++20 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++20" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++20")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++20 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2018-01-06 10:00:24 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# gnu++20 debug and release build
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_GNU20" -ne 0 ]]; then
|
2018-01-06 10:00:24 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, gnu++20" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, gnu++20")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=gnu++20 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, gnu++20" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, gnu++20")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=gnu++20 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2018-01-06 10:00:24 +00:00
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
############################################
|
|
|
|
# X32 debug and release build
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_X32" -ne 0 ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, X32" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, X32")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -mx32 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, X32" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, X32")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -mx32 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
2016-10-26 07:10:52 +00:00
|
|
|
# init_priority
|
|
|
|
if true; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, INIT_PRIORITY (0)" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, INIT_PRIORITY (0)")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -DCRYPTOPP_INIT_PRIORITY=0 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, INIT_PRIORITY (0)" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, INIT_PRIORITY (0)")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -DCRYPTOPP_INIT_PRIORITY=0 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
2016-10-26 07:10:52 +00:00
|
|
|
# OS Independence
|
|
|
|
if true; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, NO_OS_DEPENDENCE" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, NO_OS_DEPENDENCE")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -DNO_OS_DEPENDENCE $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, NO_OS_DEPENDENCE" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, NO_OS_DEPENDENCE")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -DNO_OS_DEPENDENCE $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Build with LD-Gold
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_LDGOLD" -ne 0 ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, ld-gold linker" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, ld-gold linker")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" LD="ld.gold" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, ld-gold linker" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, ld-gold linker")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" LD="ld.gold" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2018-02-21 08:22:34 +00:00
|
|
|
############################################
|
|
|
|
# Build at -O2
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_O2" -ne 0 ]]; then
|
2018-02-21 08:22:34 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, -O2 optimizations" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, -O2 optimizations")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DDEBUG $OPT_O2 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, -O2 optimizations" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, -O2 optimizations")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG $OPT_O2 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2018-02-21 08:22:34 +00:00
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
############################################
|
|
|
|
# Build at -O3
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_O3" -ne 0 ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, -O3 optimizations" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, -O3 optimizations")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DDEBUG $OPT_O3 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, -O3 optimizations" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, -O3 optimizations")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG $OPT_O3 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Build at -Os
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_OS" -ne 0 ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, -Os optimizations" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, -Os optimizations")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DDEBUG $OPT_OS $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, -Os optimizations" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, -Os optimizations")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG $OPT_OS $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
2021-02-07 17:10:46 +00:00
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Build at -Oz
|
|
|
|
if [[ "$HAVE_OZ" -ne 0 ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, -Oz optimizations" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, -Oz optimizations")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
|
|
|
|
CXXFLAGS="-DDEBUG $OPT_OZ $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, -Oz optimizations" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, -Oz optimizations")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG $OPT_OZ $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Build at -Ofast
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_OFAST" -ne 0 ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, -Ofast optimizations" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, -Ofast optimizations")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DDEBUG $OPT_OFAST $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, -Ofast optimizations" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, -Ofast optimizations")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG $OPT_OFAST $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Dead code stripping
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$GNU_LINKER" -eq 1) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, dead code strip" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, dead code strip")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" lean 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, dead code strip" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, dead code strip")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" lean 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# OpenMP
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_OMP" -ne 0) ]]; then
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, OpenMP" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, OpenMP")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DDEBUG ${OMP_FLAGS[*]} $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, OpenMP" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, OpenMP")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG ${OMP_FLAGS[*]} $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# UBSan, c++03
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX03" -ne 0 && "$HAVE_UBSAN" -ne 0) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build, UBSan, c++03
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, c++03, UBsan" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, c++03, UBsan")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++03 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" ubsan | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build, UBSan, c++03
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++03, UBsan" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++03, UBsan")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++03 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" ubsan | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Asan, c++03
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX03" -ne 0 && "$HAVE_ASAN" -ne 0) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build, Asan, c++03
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, c++03, Asan" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, c++03, Asan")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++03 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" asan | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
if [[ ("$HAVE_SYMBOLIZE" -ne 0) ]]; then
|
|
|
|
./cryptest.exe v 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build, Asan, c++03
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++03, Asan" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++03, Asan")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++03 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" asan | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
if [[ ("$HAVE_SYMBOLIZE" -ne 0) ]]; then
|
|
|
|
./cryptest.exe v 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Bounds Sanitizer, c++03
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX03" -ne 0 && "$HAVE_BSAN" -ne 0) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build, Bounds Sanitizer, c++03
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, c++03, Bounds Sanitizer" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, c++03, Bounds Sanitizer")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++03 -fsanitize=bounds-strict $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
if [[ ("$HAVE_SYMBOLIZE" -ne 0) ]]; then
|
|
|
|
./cryptest.exe v 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build, Bounds Sanitizer, c++03
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++03, Bounds Sanitizer" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++03, Bounds Sanitizer")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++03 -fsanitize=bounds-strict $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
if [[ ("$HAVE_SYMBOLIZE" -ne 0) ]]; then
|
|
|
|
./cryptest.exe v 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
2018-02-21 09:23:46 +00:00
|
|
|
|
2017-10-30 12:19:50 +00:00
|
|
|
############################################
|
2018-02-21 13:06:51 +00:00
|
|
|
# Control-flow Enforcement Technology (CET), c++03
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX11" -ne 0 && "$HAVE_CET" -ne 0) ]]; then
|
2017-10-30 12:19:50 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build, CET, c++03
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, c++03, CET" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, c++03, CET")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++03 -fcf-protection=full -mcet $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build, CET, c++03
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++03, CET" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++03, CET")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++03 -fcf-protection=full -mcet $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2017-10-30 12:19:50 +00:00
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2018-02-21 09:23:46 +00:00
|
|
|
############################################
|
2018-02-21 13:06:51 +00:00
|
|
|
# Specter, c++03
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX11" -ne 0 && "$HAVE_REPTOLINE" -ne 0) ]]; then
|
2018-02-21 09:23:46 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build, Specter, c++03
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, c++03, Specter" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, c++03, Specter")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++03 -mfunction-return=thunk -mindirect-branch=thunk $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build, Specter, c++03
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++03, Specter" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++03, Specter")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++03 -mfunction-return=thunk -mindirect-branch=thunk $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2018-02-21 09:23:46 +00:00
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
############################################
|
|
|
|
# UBSan, c++11
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX11" -ne 0 && "$HAVE_UBSAN" -ne 0) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build, UBSan, c++11
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, c++11, UBsan" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, c++11, UBsan")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++11 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" ubsan | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build, UBSan, c++11
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++11, UBsan" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++11, UBsan")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++11 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" ubsan | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Asan, c++11
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX11" -ne 0 && "$HAVE_ASAN" -ne 0) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build, Asan, c++11
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, c++11, Asan" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, c++11, Asan")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++11 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" asan | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
if [[ ("$HAVE_SYMBOLIZE" -ne 0) ]]; then
|
|
|
|
./cryptest.exe v 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build, Asan, c++11
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++11, Asan" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++11, Asan")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++11 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" asan | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
if [[ ("$HAVE_SYMBOLIZE" -ne 0) ]]; then
|
|
|
|
./cryptest.exe v 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Bounds Sanitizer, c++11
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX11" -ne 0 && "$HAVE_BSAN" -ne 0) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build, Bounds Sanitizer, c++11
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, c++11, Bounds Sanitizer" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, c++11, Bounds Sanitizer")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++11 -fsanitize=bounds-strict $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
if [[ ("$HAVE_SYMBOLIZE" -ne 0) ]]; then
|
|
|
|
./cryptest.exe v 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build, Bounds Sanitizer, c++11
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++11, Bounds Sanitizer" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++11, Bounds Sanitizer")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++11 -fsanitize=bounds-strict $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
if [[ ("$HAVE_SYMBOLIZE" -ne 0) ]]; then
|
|
|
|
./cryptest.exe v 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2017-10-30 12:19:50 +00:00
|
|
|
############################################
|
2018-02-21 13:06:51 +00:00
|
|
|
# Control-flow Enforcement Technology (CET), c++11
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX11" -ne 0 && "$HAVE_CET" -ne 0) ]]; then
|
2017-10-30 12:19:50 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build, CET, c++11
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, c++11, CET" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, c++11, CET")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++11 -fcf-protection=full -mcet $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build, CET, c++11
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++11, CET" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++11, CET")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++11 -fcf-protection=full -mcet $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2017-10-30 12:19:50 +00:00
|
|
|
fi
|
|
|
|
|
2018-02-21 09:23:46 +00:00
|
|
|
############################################
|
2018-02-21 13:06:51 +00:00
|
|
|
# Specter, c++11
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX11" -ne 0 && "$HAVE_REPTOLINE" -ne 0) ]]; then
|
2018-02-21 09:23:46 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build, Specter, c++11
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, c++11, Specter" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, c++11, Specter")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++11 -mfunction-return=thunk -mindirect-branch=thunk $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build, Specter, c++11
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++11, Specter" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++11, Specter")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++11 -mfunction-return=thunk -mindirect-branch=thunk $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2018-02-21 09:23:46 +00:00
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
############################################
|
|
|
|
# Release build, UBSan, c++14
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX14" -ne 0 && "$HAVE_UBSAN" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++14, UBsan" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Release, c++14, UBsan")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++14 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" ubsan | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build, Asan, c++14
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX14" -ne 0 && "$HAVE_ASAN" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++14, Asan" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++14, Asan")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++14 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" asan | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
if [[ ("$HAVE_SYMBOLIZE" -ne 0) ]]; then
|
|
|
|
./cryptest.exe v 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build, Bounds Sanitizer, c++14
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX14" -ne 0 && "$HAVE_BSAN" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++14, Bounds Sanitizer" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Release, c++14, Bounds Sanitizer")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++14 -fsanitize=bounds-strict $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2017-10-30 12:19:50 +00:00
|
|
|
############################################
|
|
|
|
# Release build, Control-flow Enforcement Technology (CET), c++14
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX14" -ne 0 && "$HAVE_CET" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++14, CET" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2017-10-30 12:19:50 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Release, c++14, CET")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2017-10-30 12:19:50 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++14 -fcf-protection=full -mcet $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
2017-10-30 12:19:50 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2017-10-30 12:19:50 +00:00
|
|
|
fi
|
|
|
|
|
2018-02-21 09:23:46 +00:00
|
|
|
############################################
|
2018-02-21 13:06:51 +00:00
|
|
|
# Release build, Specter, c++14
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX14" -ne 0 && "$HAVE_REPTOLINE" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++14, Specter" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2018-02-21 09:23:46 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Release, c++14, Specter")
|
2018-02-21 09:23:46 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2018-02-21 09:23:46 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++14 -mfunction-return=thunk -mindirect-branch=thunk $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
2018-02-21 09:23:46 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2018-02-21 09:23:46 +00:00
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
############################################
|
|
|
|
# Release build, UBSan, c++17
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX17" -ne 0 && "$HAVE_UBSAN" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++17, UBsan" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Release, c++17, UBsan")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++17 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" ubsan | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build, Asan, c++17
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX17" -ne 0 && "$HAVE_ASAN" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++17, Asan" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++17, Asan")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++17 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" asan | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
if [[ ("$HAVE_SYMBOLIZE" -ne 0) ]]; then
|
|
|
|
./cryptest.exe v 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build, Bounds Sanitizer, c++17
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX17" -ne 0 && "$HAVE_BSAN" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++17, Bounds Sanitizer" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Release, c++17, Bounds Sanitizer")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++17 -fsanitize=bounds-strict $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2017-10-30 12:19:50 +00:00
|
|
|
############################################
|
|
|
|
# Release build, Control-flow Enforcement Technology (CET), c++17
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX17" -ne 0 && "$HAVE_CET" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++17, CET" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2017-10-30 12:19:50 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Release, c++17, CET")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2017-10-30 12:19:50 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++17 -fcf-protection=full -mcet $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
2017-10-30 12:19:50 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2017-10-30 12:19:50 +00:00
|
|
|
fi
|
|
|
|
|
2018-02-21 09:23:46 +00:00
|
|
|
############################################
|
2018-02-21 13:06:51 +00:00
|
|
|
# Release build, Specter, c++17
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX17" -ne 0 && "$HAVE_REPTOLINE" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++17, Specter" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2018-02-21 09:23:46 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Release, c++17, Specter")
|
2018-02-21 09:23:46 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2018-02-21 09:23:46 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++17 -mfunction-return=thunk -mindirect-branch=thunk $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
2018-02-21 09:23:46 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2018-02-21 09:23:46 +00:00
|
|
|
fi
|
|
|
|
|
2018-01-06 10:00:24 +00:00
|
|
|
############################################
|
|
|
|
# Release build, UBSan, c++20
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX20" -ne 0 && "$HAVE_UBSAN" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++20, UBsan" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2018-01-06 10:00:24 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Release, c++20, UBsan")
|
2018-01-06 10:00:24 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2018-01-06 10:00:24 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++20 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" ubsan | tee -a "$TEST_RESULTS"
|
2018-01-06 10:00:24 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2018-01-06 10:00:24 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build, Asan, c++20
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX20" -ne 0 && "$HAVE_ASAN" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++20, Asan" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, c++20, Asan")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++20 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" asan | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
if [[ ("$HAVE_SYMBOLIZE" -ne 0) ]]; then
|
|
|
|
./cryptest.exe v 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | "$ASAN_SYMBOLIZE" 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2018-01-06 10:00:24 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build, Bounds Sanitizer, c++20
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX20" -ne 0 && "$HAVE_BSAN" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++20, Bounds Sanitizer" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2018-01-06 10:00:24 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Release, c++20, Bounds Sanitizer")
|
2018-01-06 10:00:24 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2018-01-06 10:00:24 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++20 -fsanitize=bounds-strict $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
2018-01-06 10:00:24 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2018-01-06 10:00:24 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build, Control-flow Enforcement Technology (CET), c++20
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX20" -ne 0 && "$HAVE_CET" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++20, CET" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2018-01-06 10:00:24 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Release, c++20, CET")
|
2018-01-06 10:00:24 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2018-01-06 10:00:24 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++20 -fcf-protection=full -mcet $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
2018-01-06 10:00:24 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2018-02-21 09:23:46 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
2018-02-21 13:06:51 +00:00
|
|
|
# Release build, Specter, c++20
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX20" -ne 0 && "$HAVE_REPTOLINE" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, c++20, Specter" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2018-02-21 09:23:46 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Release, c++20, Specter")
|
2018-02-21 09:23:46 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2018-02-21 09:23:46 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++20 -mfunction-return=thunk -mindirect-branch=thunk $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" | tee -a "$TEST_RESULTS"
|
2018-02-21 09:23:46 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2018-01-06 10:00:24 +00:00
|
|
|
fi
|
|
|
|
|
2020-05-09 21:55:44 +00:00
|
|
|
############################################
|
|
|
|
# Analyze debug and release build
|
2020-05-11 19:22:20 +00:00
|
|
|
if [[ "$HAVE_ANALYZER" -ne 0 ]]; then
|
2020-05-09 21:55:44 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Debug, Analyze" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Debug, Analyze")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -fanalyzer $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Release, Analyze" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Release, Analyze")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -fanalyzer $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2020-05-09 21:55:44 +00:00
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
############################################
|
|
|
|
# For Solaris, test under Sun Studio 12.2 - 12.5
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$IS_SOLARIS" -ne 0 ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Sun Studio 12.2/SunCC 5.11
|
|
|
|
if [[ (-e "/opt/solstudio12.2/bin/CC") ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Sun Studio 12.2, debug, platform CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Sun Studio 12.2, debug, platform CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DDEBUG -g -xO0"
|
|
|
|
CXX="/opt/solstudio12.2/bin/CC" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Sun Studio 12.2, release, platform CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Testing: Sun Studio 12.2, release, platform CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG -g -xO2"
|
|
|
|
CXX="/opt/solstudio12.2/bin/CC" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Sun Studio 12.3/SunCC 5.12
|
|
|
|
if [[ (-e "/opt/solarisstudio12.3/bin/CC") ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Sun Studio 12.3, debug, platform CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Sun Studio 12.3, debug, platform CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DDEBUG -g3 -xO0"
|
|
|
|
CXX=/opt/solarisstudio12.3/bin/CC CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Sun Studio 12.3, release, platform CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Sun Studio 12.3, release, platform CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG -g3 -xO2"
|
|
|
|
CXX=/opt/solarisstudio12.3/bin/CC CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Sun Studio 12.4/SunCC 5.13
|
|
|
|
if [[ (-e "/opt/solarisstudio12.4/bin/CC") ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Sun Studio 12.4, debug, platform CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Sun Studio 12.4, debug, platform CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DDEBUG -g3 -xO0"
|
|
|
|
CXX=/opt/solarisstudio12.4/bin/CC CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Sun Studio 12.4, release, platform CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Sun Studio 12.4, release, platform CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG -g2 -xO2"
|
|
|
|
CXX=/opt/solarisstudio12.4/bin/CC CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Sun Studio 12.5/SunCC 5.14
|
|
|
|
if [[ (-e "/opt/developerstudio12.5/bin/CC") ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Sun Studio 12.5, debug, platform CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Sun Studio 12.5, debug, platform CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DDEBUG -g3 -xO1"
|
|
|
|
CXX=/opt/developerstudio12.5/bin/CC CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Sun Studio 12.5, release, platform CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Sun Studio 12.5, release, platform CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG -g2 -xO2"
|
|
|
|
CXX=/opt/developerstudio12.5/bin/CC CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Sun Studio 12.6/SunCC 5.15
|
|
|
|
if [[ (-e "/opt/developerstudio12.6/bin/CC") ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Sun Studio 12.6, debug, platform CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Sun Studio 12.6, debug, platform CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DDEBUG -g3 -xO1"
|
|
|
|
CXX=/opt/developerstudio12.6/bin/CC CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Sun Studio 12.6, release, platform CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Sun Studio 12.6, release, platform CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG -g2 -xO2"
|
|
|
|
CXX=/opt/developerstudio12.6/bin/CC CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# GCC on Solaris
|
|
|
|
if [[ (-e "/bin/g++") ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Solaris GCC, debug, default CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Solaris GCC, debug, default CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DDEBUG -g3 -O0"
|
|
|
|
CXX="/bin/g++" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Soalris GCC, release, default CXXFLAGS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Soalris GCC, release, default CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG -g2 -O3"
|
|
|
|
CXX="/bin/g++" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# For Darwin, we need to test both -stdlib=libstdc++ (GNU) and
|
|
|
|
# -stdlib=libc++ (LLVM) crossed with -std=c++03, -std=c++11, and -std=c++17
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Darwin, c++03, libc++
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_DARWIN" -ne 0) && ("$HAVE_CXX03" -ne 0 && "$CLANG_COMPILER" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Darwin, c++03, libc++ (LLVM)" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Darwin, c++03, libc++ (LLVM)")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++03 -stdlib=libc++ $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Darwin, c++03, libstdc++
|
2021-03-06 09:08:03 +00:00
|
|
|
if [[ ("$IS_DARWIN" -ne 0 && "$HAVE_CXX03" -ne 0) && ("$HAVE_LIBSTDCXX" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Darwin, c++03, libstdc++ (GNU)" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Darwin, c++03, libstdc++ (GNU)")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++03 -stdlib=libstdc++ $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Darwin, c++11, libc++
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_DARWIN" -ne 0 && "$HAVE_CXX11" -ne 0 && "$CLANG_COMPILER" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Darwin, c++11, libc++ (LLVM)" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Darwin, c++11, libc++ (LLVM)")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++11 -stdlib=libc++ $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Darwin, c++11, libstdc++
|
2021-03-06 09:08:03 +00:00
|
|
|
if [[ ("$IS_DARWIN" -ne 0 && "$HAVE_CXX11" -ne 0) && ("$HAVE_LIBSTDCXX" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Darwin, c++11, libstdc++ (GNU)" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Darwin, c++11, libstdc++ (GNU)")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++11 -stdlib=libstdc++ $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Darwin, c++14, libc++
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_DARWIN" -ne 0 && "$HAVE_CXX14" -ne 0 && "$CLANG_COMPILER" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Darwin, c++14, libc++ (LLVM)" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Darwin, c++14, libc++ (LLVM)")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++14 -stdlib=libc++ $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Darwin, c++14, libstdc++
|
2021-03-06 09:08:03 +00:00
|
|
|
if [[ ("$IS_DARWIN" -ne 0 && "$HAVE_CXX14" -ne 0) && ("$HAVE_LIBSTDCXX" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Darwin, c++14, libstdc++ (GNU)" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Darwin, c++14, libstdc++ (GNU)")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++14 -stdlib=libstdc++ $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Darwin, c++17, libc++
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_DARWIN" -ne 0 && "$HAVE_CXX17" -ne 0 && "$CLANG_COMPILER" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Darwin, c++17, libc++ (LLVM)" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Darwin, c++17, libc++ (LLVM)")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++17 -stdlib=libc++ $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Darwin, c++17, libstdc++
|
2021-03-06 09:08:03 +00:00
|
|
|
if [[ ("$IS_DARWIN" -ne 0 && "$HAVE_CXX17" -ne 0) && ("$HAVE_LIBSTDCXX" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Darwin, c++17, libstdc++ (GNU)" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Darwin, c++17, libstdc++ (GNU)")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++17 -stdlib=libstdc++ $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Darwin, Intel multiarch, c++03
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$IS_DARWIN" -ne 0 && "$HAVE_INTEL_MULTIARCH" -ne 0 && "$HAVE_CXX03" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Darwin, Intel multiarch, c++03" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Darwin, Intel multiarch, c++03")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
2020-07-26 12:26:14 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -arch i386 -arch x86_64 -std=c++03 $USER_CXXFLAGS"
|
2020-05-10 03:16:29 +00:00
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
echo "Running i386 version..."
|
|
|
|
arch -i386 ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite (i386)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
arch -i386 ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors (i386)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Running x86_64 version..."
|
|
|
|
arch -x86_64 ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite (x86_64)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
arch -x86_64 ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors (x86_64)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Darwin, Intel multiarch, c++11
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$IS_DARWIN" -ne 0 && "$HAVE_INTEL_MULTIARCH" -ne 0 && "$HAVE_CXX11" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Darwin, Intel multiarch, c++11" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Darwin, Intel multiarch, c++11")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
2020-07-26 12:26:14 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -arch i386 -arch x86_64 -std=c++11 $USER_CXXFLAGS"
|
2020-05-10 03:16:29 +00:00
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
echo "Running i386 version..."
|
|
|
|
arch -i386 ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite (i386)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
arch -i386 ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors (i386)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Running x86_64 version..."
|
|
|
|
arch -x86_64 ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite (x86_64)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
arch -x86_64 ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors (x86_64)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Darwin, Intel multiarch, c++14
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$IS_DARWIN" -ne 0 && "$HAVE_INTEL_MULTIARCH" -ne 0 && "$HAVE_CXX14" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Darwin, Intel multiarch, c++14" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Darwin, Intel multiarch, c++14")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
2020-07-26 12:26:14 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -arch i386 -arch x86_64 -std=c++14 $USER_CXXFLAGS"
|
2020-05-10 03:16:29 +00:00
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
echo "Running i386 version..."
|
|
|
|
arch -i386 ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite (i386)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
arch -i386 ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors (i386)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Running x86_64 version..."
|
|
|
|
arch -x86_64 ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite (x86_64)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
arch -x86_64 ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors (x86_64)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Darwin, Intel multiarch, c++17
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$IS_DARWIN" -ne 0 && "$HAVE_INTEL_MULTIARCH" -ne 0 && "$HAVE_CXX17" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Darwin, Intel multiarch, c++17" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Darwin, Intel multiarch, c++17")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
2020-07-26 12:26:14 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -arch i386 -arch x86_64 -std=c++17 $USER_CXXFLAGS"
|
2020-05-10 03:16:29 +00:00
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
echo "Running i386 version..."
|
|
|
|
arch -i386 ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite (i386)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
arch -i386 ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors (i386)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Running x86_64 version..."
|
|
|
|
arch -x86_64 ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite (x86_64)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
arch -x86_64 ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors (x86_64)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Darwin, PowerPC multiarch
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_DARWIN" -ne 0 && "$HAVE_PPC_MULTIARCH" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Darwin, PowerPC multiarch" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Darwin, PowerPC multiarch")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
2020-07-26 12:26:14 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -arch ppc -arch ppc64 $USER_CXXFLAGS"
|
2020-05-10 03:16:29 +00:00
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
echo "Running PPC version..."
|
|
|
|
arch -ppc ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite (PPC)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
arch -ppc ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors (PPC)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Running PPC64 version..."
|
|
|
|
arch -ppc64 ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite (PPC64)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
arch -ppc64 ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors (PPC64)" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Darwin, c++03, Malloc Guards
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_DARWIN" -ne 0 && "$HAVE_CXX03" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Darwin, c++03, Malloc Guards" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Darwin, c++03, Malloc Guards")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++03 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
export MallocScribble=1
|
|
|
|
export MallocPreScribble=1
|
|
|
|
export MallocGuardEdges=1
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
unset MallocScribble MallocPreScribble MallocGuardEdges
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Darwin, c++11, Malloc Guards
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_DARWIN" -ne 0 && "$HAVE_CXX11" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Darwin, c++11, Malloc Guards" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Darwin, c++11, Malloc Guards")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++11 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
export MallocScribble=1
|
|
|
|
export MallocPreScribble=1
|
|
|
|
export MallocGuardEdges=1
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
unset MallocScribble MallocPreScribble MallocGuardEdges
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Darwin, c++14, Malloc Guards
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_DARWIN" -ne 0 && "$HAVE_CXX14" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Darwin, c++14, Malloc Guards" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Darwin, c++14, Malloc Guards")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++14 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
export MallocScribble=1
|
|
|
|
export MallocPreScribble=1
|
|
|
|
export MallocGuardEdges=1
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
unset MallocScribble MallocPreScribble MallocGuardEdges
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Darwin, c++17, Malloc Guards
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_DARWIN" -ne 0 && "$HAVE_CXX17" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Darwin, c++17, Malloc Guards" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Darwin, c++17, Malloc Guards")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++17 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
export MallocScribble=1
|
|
|
|
export MallocPreScribble=1
|
|
|
|
export MallocGuardEdges=1
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
unset MallocScribble MallocPreScribble MallocGuardEdges
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2017-08-25 17:58:34 +00:00
|
|
|
############################################
|
2016-09-23 15:32:14 +00:00
|
|
|
# Benchmarks
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$WANT_BENCHMARKS" -ne 0 ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Benchmarks, c++03
|
|
|
|
if [[ "$HAVE_CXX03" -ne 0 ]]; then
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Benchmarks, c++03" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Testing: Benchmarks, c++03")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++03 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
echo "**************************************" >> "$BENCHMARK_RESULTS"
|
|
|
|
./cryptest.exe b 3 "$CPU_FREQ" 2>&1 | tee -a "$BENCHMARK_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute benchmarks" | tee -a "$BENCHMARK_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Benchmarks, c++11
|
|
|
|
if [[ "$HAVE_CXX11" -ne 0 ]]; then
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Benchmarks, c++11" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Testing: Benchmarks, c++11")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++11 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
echo "**************************************" >> "$BENCHMARK_RESULTS"
|
|
|
|
./cryptest.exe b 3 "$CPU_FREQ" 2>&1 | tee -a "$BENCHMARK_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute benchmarks" | tee -a "$BENCHMARK_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Benchmarks, c++14
|
|
|
|
if [[ "$HAVE_CXX14" -ne 0 ]]; then
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Benchmarks, c++14" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Benchmarks, c++14")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++14 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
echo "**************************************" >> "$BENCHMARK_RESULTS"
|
|
|
|
./cryptest.exe b 3 "$CPU_FREQ" 2>&1 | tee -a "$BENCHMARK_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute benchmarks" | tee -a "$BENCHMARK_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# For Cygwin, we need to test both PREFER_BERKELEY_STYLE_SOCKETS
|
|
|
|
# and PREFER_WINDOWS_STYLE_SOCKETS
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# MinGW and PREFER_BERKELEY_STYLE_SOCKETS
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$IS_MINGW" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: MinGW, PREFER_BERKELEY_STYLE_SOCKETS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("MinGW, PREFER_BERKELEY_STYLE_SOCKETS")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -DPREFER_BERKELEY_STYLE_SOCKETS -DNO_WINDOWS_STYLE_SOCKETS $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# MinGW and PREFER_WINDOWS_STYLE_SOCKETS
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$IS_MINGW" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: MinGW, PREFER_WINDOWS_STYLE_SOCKETS" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("MinGW, PREFER_WINDOWS_STYLE_SOCKETS")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -DPREFER_WINDOWS_STYLE_SOCKETS -DNO_BERKELEY_STYLE_SOCKETS $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Valgrind, c++03. Requires -O1 for accurate results
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$HAVE_CXX03" -ne 0 && "$HAVE_VALGRIND" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Valgrind, c++03" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Valgrind, c++03")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$VALGRIND_CXXFLAGS -std=c++03 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
valgrind --track-origins=yes --suppressions=cryptopp.supp ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
valgrind --track-origins=yes --suppressions=cryptopp.supp ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Valgrind, c++11. Requires -O1 for accurate results
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_VALGRIND" -ne 0 && "$HAVE_CXX11" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Valgrind, c++11" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Valgrind, c++11")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$VALGRIND_CXXFLAGS -std=c++11 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
valgrind --track-origins=yes --suppressions=cryptopp.supp ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
valgrind --track-origins=yes --suppressions=cryptopp.supp ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Valgrind, c++14. Requires -O1 for accurate results
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_VALGRIND" -ne 0 && "$HAVE_CXX14" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Valgrind, c++14" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Valgrind, c++14")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$VALGRIND_CXXFLAGS -std=c++14 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
valgrind --track-origins=yes --suppressions=cryptopp.supp ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
valgrind --track-origins=yes --suppressions=cryptopp.supp ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Valgrind, c++17. Requires -O1 for accurate results
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_VALGRIND" -ne 0 && "$HAVE_CXX17" -ne 0) ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Valgrind, c++17" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Valgrind, c++17")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$VALGRIND_CXXFLAGS -std=c++17 $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
valgrind --track-origins=yes --suppressions=cryptopp.supp ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
valgrind --track-origins=yes --suppressions=cryptopp.supp ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# C++03 with elevated warnings
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX03" -ne 0 && ("$GCC_COMPILER" -ne 0 || "$CLANG_COMPILER" -ne 0)) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$WARN_RESULTS"
|
|
|
|
echo "Testing: Debug, c++03, elevated warnings" | tee -a "$WARN_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Debug, c++03, elevated warnings")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++03 ${WARNING_CXXFLAGS[*]}"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$WARN_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$WARN_RESULTS"
|
|
|
|
echo "Testing: Release, c++03, elevated warnings" | tee -a "$WARN_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Release, c++03, elevated warnings")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++03 ${WARNING_CXXFLAGS[*]}"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_RESULTS"
|
|
|
|
if [[ "$?" -ne 0 ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$WARN_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# C++11 with elevated warnings
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX11" -ne 0 && ("$GCC_COMPILER" -ne 0 || "$CLANG_COMPILER" -ne 0)) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$WARN_RESULTS"
|
|
|
|
echo "Testing: Debug, c++11, elevated warnings" | tee -a "$WARN_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Debug, c++11, elevated warnings")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++11 ${WARNING_CXXFLAGS[*]}"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$WARN_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$WARN_RESULTS"
|
|
|
|
echo "Testing: Release, c++11, elevated warnings" | tee -a "$WARN_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Release, c++11, elevated warnings")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++11 ${WARNING_CXXFLAGS[*]}"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_RESULTS"
|
|
|
|
if [[ "$?" -ne 0 ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$WARN_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# C++14 with elevated warnings
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX14" -ne 0 && ("$GCC_COMPILER" -ne 0 || "$CLANG_COMPILER" -ne 0)) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$WARN_RESULTS"
|
|
|
|
echo "Testing: Debug, c++14, elevated warnings" | tee -a "$WARN_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Debug, c++14, elevated warnings")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++14 ${WARNING_CXXFLAGS[*]}"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$WARN_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$WARN_RESULTS"
|
|
|
|
echo "Testing: Release, c++14, elevated warnings" | tee -a "$WARN_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Release, c++14, elevated warnings")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++14 ${WARNING_CXXFLAGS[*]}"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_RESULTS"
|
|
|
|
if [[ "$?" -ne 0 ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$WARN_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# C++17 with elevated warnings
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX17" -ne 0 && ("$GCC_COMPILER" -ne 0 || "$CLANG_COMPILER" -ne 0)) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$WARN_RESULTS"
|
|
|
|
echo "Testing: Debug, c++17, elevated warnings" | tee -a "$WARN_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Debug, c++17, elevated warnings")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++17 ${WARNING_CXXFLAGS[*]}"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$WARN_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$WARN_RESULTS"
|
|
|
|
echo "Testing: Release, c++17, elevated warnings" | tee -a "$WARN_RESULTS"
|
|
|
|
echo
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Release, c++17, elevated warnings")
|
2017-11-13 21:57:03 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++17 ${WARNING_CXXFLAGS[*]}"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_RESULTS"
|
2018-01-14 08:34:25 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -ne 0 ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$WARN_RESULTS"
|
|
|
|
fi
|
2018-01-14 08:34:25 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# C++20 with elevated warnings
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$HAVE_CXX20" -ne 0 && ("$GCC_COMPILER" -ne 0 || "$CLANG_COMPILER" -ne 0)) ]]; then
|
2018-01-14 08:34:25 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$WARN_RESULTS"
|
|
|
|
echo "Testing: Debug, c++20, elevated warnings" | tee -a "$WARN_RESULTS"
|
|
|
|
echo
|
2018-01-14 08:34:25 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Debug, c++20, elevated warnings")
|
2018-01-14 08:34:25 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2018-01-14 08:34:25 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS -std=c++20 ${WARNING_CXXFLAGS[*]}"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_RESULTS"
|
2018-01-14 08:34:25 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$WARN_RESULTS"
|
|
|
|
fi
|
2018-01-14 08:34:25 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$WARN_RESULTS"
|
|
|
|
echo "Testing: Release, c++20, elevated warnings" | tee -a "$WARN_RESULTS"
|
|
|
|
echo
|
2018-01-14 08:34:25 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
TEST_LIST+=("Release, c++20, elevated warnings")
|
2018-01-14 08:34:25 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2018-01-14 08:34:25 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -std=c++20 ${WARNING_CXXFLAGS[*]}"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$WARN_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -ne 0 ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$WARN_RESULTS"
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Perform a quick check with Clang, if available.
|
|
|
|
# This check was added after testing on Ubuntu 14.04 with Clang 3.4.
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$CLANG_COMPILER" -eq 0) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
CLANG_CXX=$(command -v clang++ 2>/dev/null)
|
2021-02-07 16:44:15 +00:00
|
|
|
"$CLANG_CXX" -x c++ -DCRYPTOPP_ADHOC_MAIN "$test_prog".proto -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Clang build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Clang compiler" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Clang compiler")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG -g2 -O3"
|
|
|
|
CXX="$CLANG_CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Perform a quick check with GCC, if available.
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$GCC_COMPILER" -eq 0) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
GCC_CXX=$(command -v g++ 2>/dev/null)
|
2021-02-07 16:44:15 +00:00
|
|
|
"$GCC_CXX" -x c++ -DCRYPTOPP_ADHOC_MAIN "$test_prog".proto -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# GCC build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: GCC compiler" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("GCC compiler")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG -g2 -O3"
|
|
|
|
CXX="$GCC_CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Perform a quick check with Intel ICPC, if available.
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$INTEL_COMPILER" -eq 0) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
INTEL_CXX=$(command -v icpc 2>/dev/null)
|
|
|
|
if [[ (-z "$INTEL_CXX") ]]; then
|
|
|
|
INTEL_CXX=$(find /opt/intel -name icpc 2>/dev/null | "$GREP" -iv composer | head -1)
|
|
|
|
fi
|
2021-02-07 16:44:15 +00:00
|
|
|
"$INTEL_CXX" -x c++ -DCRYPTOPP_ADHOC_MAIN "$test_prog".proto -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Intel build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Intel compiler" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Intel compiler")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG -g2 -O3"
|
|
|
|
CXX="$INTEL_CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Perform a quick check with MacPorts compilers, if available.
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_DARWIN" -ne 0 && "$MACPORTS_COMPILER" -eq 0) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
MACPORTS_CXX=$(find /opt/local/bin -name 'g++-mp-4*' 2>/dev/null | head -1)
|
|
|
|
if [[ (-n "$MACPORTS_CXX") ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$MACPORTS_CXX" -x c++ -std=c++11 -DCRYPTOPP_ADHOC_MAIN "$test_prog".proto -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# MacPorts GCC 4.x build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: MacPorts 4.x GCC compiler" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("MacPorts 4.x GCC compiler")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
# We want to use -stdlib=libstdc++ below, but it causes a compile error. Maybe MacPorts hardwired libc++.
|
|
|
|
CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++11"
|
|
|
|
CXX="$MACPORTS_CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
MACPORTS_CXX=$(find /opt/local/bin -name 'g++-mp-5*' 2>/dev/null | head -1)
|
|
|
|
if [[ (-n "$MACPORTS_CXX") ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$MACPORTS_CXX" -x c++ -std=c++11 -DCRYPTOPP_ADHOC_MAIN "$test_prog".proto -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# MacPorts GCC 5.x build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: MacPorts 5.x GCC compiler" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("MacPorts 5.x GCC compiler")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
# We want to use -stdlib=libstdc++ below, but it causes a compile error. Maybe MacPorts hardwired libc++.
|
|
|
|
CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++11"
|
|
|
|
CXX="$MACPORTS_CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
MACPORTS_CXX=$(find /opt/local/bin -name 'g++-mp-6*' 2>/dev/null | head -1)
|
|
|
|
if [[ (-n "$MACPORTS_CXX") ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$MACPORTS_CXX" -x c++ -std=c++11 -DCRYPTOPP_ADHOC_MAIN "$test_prog".proto -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# MacPorts GCC 6.x build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: MacPorts 6.x GCC compiler" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("MacPorts 6.x GCC compiler")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
# We want to use -stdlib=libstdc++ below, but it causes a compile error. Maybe MacPorts hardwired libc++.
|
|
|
|
CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++11"
|
|
|
|
CXX="$MACPORTS_CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
MACPORTS_CXX=$(find /opt/local/bin -name 'g++-mp-7*' 2>/dev/null | head -1)
|
|
|
|
if [[ (-n "$MACPORTS_CXX") ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$MACPORTS_CXX" -x c++ -std=c++11 -DCRYPTOPP_ADHOC_MAIN "$test_prog".proto -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# MacPorts GCC 7.x build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: MacPorts 7.x GCC compiler" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("MacPorts 7.x GCC compiler")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
# We want to use -stdlib=libstdc++ below, but it causes a compile error. Maybe MacPorts hardwired libc++.
|
|
|
|
CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++11"
|
|
|
|
CXX="$MACPORTS_CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
MACPORTS_CXX=$(find /opt/local/bin -name 'clang++-mp-3.7*' 2>/dev/null | head -1)
|
|
|
|
if [[ (-n "$MACPORTS_CXX") ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$MACPORTS_CXX" -x c++ -std=c++11 -DCRYPTOPP_ADHOC_MAIN "$test_prog".proto -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# MacPorts 3.7 Clang build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: MacPorts 3.7 Clang compiler" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("MacPorts 3.7 Clang compiler")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++11 -stdlib=libc++"
|
|
|
|
CXX="$MACPORTS_CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
MACPORTS_CXX=$(find /opt/local/bin -name 'clang++-mp-3.8*' 2>/dev/null | head -1)
|
|
|
|
if [[ (-n "$MACPORTS_CXX") ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$MACPORTS_CXX" -x c++ -std=c++11 -DCRYPTOPP_ADHOC_MAIN "$test_prog".proto -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# MacPorts 3.8 Clang build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: MacPorts 3.8 Clang compiler" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("MacPorts 3.8 Clang compiler")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++11 -stdlib=libc++"
|
|
|
|
CXX="$MACPORTS_CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
MACPORTS_CXX=$(find /opt/local/bin -name 'clang++-mp-3.9*' 2>/dev/null | head -1)
|
|
|
|
if [[ (-n "$MACPORTS_CXX") ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$MACPORTS_CXX" -x c++ -std=c++11 -DCRYPTOPP_ADHOC_MAIN "$test_prog".proto -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# MacPorts 3.9 Clang build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: MacPorts 3.9 Clang compiler" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("MacPorts 3.9 Clang compiler")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++11 -stdlib=libc++"
|
|
|
|
CXX="$MACPORTS_CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
MACPORTS_CXX=$(find /opt/local/bin -name 'clang++-mp-4*' 2>/dev/null | head -1)
|
|
|
|
if [[ (-n "$MACPORTS_CXX") ]]; then
|
2021-02-07 16:44:15 +00:00
|
|
|
"$MACPORTS_CXX" -x c++ -std=c++11 -DCRYPTOPP_ADHOC_MAIN "$test_prog".proto -o "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
if [[ "$?" -eq 0 ]]; then
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# MacPorts 4.x Clang build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: MacPorts 4.x Clang compiler" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("MacPorts 4.x Clang compiler")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++11 -stdlib=libc++"
|
|
|
|
CXX="$MACPORTS_CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Perform a quick check with Xcode compiler, if available.
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ "$IS_DARWIN" -ne 0 ]]; then
|
2020-05-10 03:16:29 +00:00
|
|
|
XCODE_CXX=$(find /Applications/Xcode*.app/Contents/Developer -name clang++ 2>/dev/null | head -1)
|
|
|
|
if [[ (-z "$XCODE_CXX") ]]; then
|
|
|
|
XCODE_CXX=$(find /Developer/Applications/Xcode.app -name clang++ 2>/dev/null | head -1)
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! (-z "$XCODE_CXX") ]]; then
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Xcode Clang compiler" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Xcode Clang compiler")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
CXXFLAGS="-DNDEBUG -g2 -O3"
|
|
|
|
CXX="$XCODE_CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Test an install with CRYPTOPP_DATA_DIR
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_CYGWIN" -eq 0) && ("$IS_MINGW" -eq 0) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
echo "Testing: Install with data directory" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Install with data directory")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2020-05-10 03:16:29 +00:00
|
|
|
|
2021-02-07 16:44:15 +00:00
|
|
|
INSTALL_DIR="${TMPDIR}/cryptopp_test"
|
2020-05-10 03:16:29 +00:00
|
|
|
rm -rf "$INSTALL_DIR" &>/dev/null
|
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS -DCRYPTOPP_DATA_DIR='\"$INSTALL_DIR/share/cryptopp/\"' $USER_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
else
|
|
|
|
OLD_DIR=$(pwd)
|
|
|
|
"$MAKE" "${MAKEARGS[@]}" install PREFIX="$INSTALL_DIR" 2>&1 | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
2021-03-08 22:23:11 +00:00
|
|
|
cd "$INSTALL_DIR/bin" || exit
|
2020-05-10 03:16:29 +00:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
echo "Testing: Install (validation suite)" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
echo
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
echo "Testing: Install (test vectors)" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
echo
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$WANT_BENCHMARKS" -ne 0 ]]; then
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
echo "Testing: Install (benchmarks)" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
echo
|
|
|
|
./cryptest.exe b 1 "$CPU_FREQ" 2>&1 | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute benchmarks" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
echo "Testing: Install (help file)" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
echo
|
|
|
|
./cryptest.exe h 2>&1 | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 1) ]]; then
|
|
|
|
echo "ERROR: failed to provide help" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Restore original PWD
|
2021-03-08 22:23:11 +00:00
|
|
|
cd "$OLD_DIR" || exit
|
2020-05-10 03:16:29 +00:00
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Test a remove with CRYPTOPP_DATA_DIR
|
2019-08-11 18:54:14 +00:00
|
|
|
if [[ ("$IS_CYGWIN" -eq 0 && "$IS_MINGW" -eq 0) ]]; then
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2020-05-10 03:16:29 +00:00
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
echo "Testing: Remove with data directory" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Remove with data directory")
|
|
|
|
|
|
|
|
"$MAKE" "${MAKEARGS[@]}" remove PREFIX="$INSTALL_DIR" 2>&1 | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make remove" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
else
|
|
|
|
# Test for complete removal
|
|
|
|
if [[ (-d "$INSTALL_DIR/include/cryptopp") ]]; then
|
|
|
|
echo "ERROR: failed to remove cryptopp include directory" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
fi
|
|
|
|
if [[ (-d "$INSTALL_DIR/share/cryptopp") ]]; then
|
|
|
|
echo "ERROR: failed to remove cryptopp share directory" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
fi
|
|
|
|
if [[ (-d "$INSTALL_DIR/share/cryptopp/TestData") ]]; then
|
|
|
|
echo "ERROR: failed to remove cryptopp test data directory" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
fi
|
|
|
|
if [[ (-d "$INSTALL_DIR/share/cryptopp/TestVector") ]]; then
|
|
|
|
echo "ERROR: failed to remove cryptopp test vector directory" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
fi
|
|
|
|
if [[ (-e "$INSTALL_DIR/bin/cryptest.exe") ]]; then
|
|
|
|
echo "ERROR: failed to remove cryptest.exe program" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
fi
|
|
|
|
if [[ (-e "$INSTALL_DIR/lib/libcryptopp.a") ]]; then
|
|
|
|
echo "ERROR: failed to remove libcryptopp.a static library" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
fi
|
|
|
|
if [[ "$IS_DARWIN" -ne 0 && (-e "$INSTALL_DIR/lib/libcryptopp.dylib") ]]; then
|
|
|
|
echo "ERROR: failed to remove libcryptopp.dylib dynamic library" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
elif [[ (-e "$INSTALL_DIR/lib/libcryptopp.so") ]]; then
|
|
|
|
echo "ERROR: failed to remove libcryptopp.so dynamic library" | tee -a "$TEST_RESULTS" "$INSTALL_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
2021-03-20 01:02:14 +00:00
|
|
|
############################################
|
|
|
|
# Test latest zip with unzip -a
|
|
|
|
if true; then
|
|
|
|
|
|
|
|
major=8; minor=5; rev=0
|
|
|
|
base="cryptopp${major}${minor}${rev}"
|
|
|
|
filename="${base}.zip"
|
|
|
|
url="https://cryptopp.com/${filename}"
|
|
|
|
|
|
|
|
rm -rf "${base}" 2>/dev/null
|
|
|
|
if wget -q -O ${filename} "${url}";
|
|
|
|
then
|
|
|
|
unzip -aoq "${filename}" -d "${base}"
|
|
|
|
cd "${base}" || exit 1
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Debug build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Latest zip, unzip -a, Debug" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Latest zip, unzip -a, Debug CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
|
|
|
|
CXXFLAGS="$DEBUG_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Release build
|
|
|
|
echo
|
|
|
|
echo "************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "Testing: Latest zip, unzip -a, Release" | tee -a "$TEST_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
TEST_LIST+=("Latest zip, unzip -a, Release CXXFLAGS")
|
|
|
|
|
|
|
|
"$MAKE" clean &>/dev/null
|
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
|
|
|
|
|
|
|
CXXFLAGS="$RELEASE_CXXFLAGS"
|
|
|
|
CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
|
|
|
|
else
|
|
|
|
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
|
|
|
|
if [[ ("${PIPESTATUS[0]}" -ne 0) ]]; then
|
|
|
|
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
|
|
|
|
fi
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd ../ || exit 1
|
|
|
|
rm -rf "${base}"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2016-09-23 15:32:14 +00:00
|
|
|
#############################################
|
|
|
|
#############################################
|
|
|
|
################ END TESTING ################
|
|
|
|
#############################################
|
|
|
|
#############################################
|
|
|
|
|
|
|
|
TEST_END=$(date)
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Cleanup, but leave output files
|
2020-05-10 03:15:04 +00:00
|
|
|
"$MAKE" clean &>/dev/null
|
2021-02-07 16:44:15 +00:00
|
|
|
rm -f "${TMPDIR}/test.exe" &>/dev/null
|
2016-09-23 15:32:14 +00:00
|
|
|
|
|
|
|
############################################
|
|
|
|
# Report tests performed
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "************************************************" | tee -a "$TEST_RESULTS"
|
|
|
|
echo "************************************************" | tee -a "$TEST_RESULTS"
|
2021-02-07 17:16:26 +00:00
|
|
|
echo "" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2017-11-13 21:57:03 +00:00
|
|
|
COUNT="${#TEST_LIST[@]}"
|
2016-09-23 15:32:14 +00:00
|
|
|
if (( "$COUNT" == "0" )); then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "No configurations tested" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
else
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "$COUNT configurations tested" | tee -a "$TEST_RESULTS"
|
|
|
|
for TEST in "${TEST_LIST[@]}"
|
|
|
|
do
|
|
|
|
echo " - $TEST" | tee -a "$TEST_RESULTS"
|
|
|
|
done
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
2021-02-07 17:16:26 +00:00
|
|
|
echo "" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
|
|
|
############################################
|
|
|
|
# Report errors
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "************************************************" | tee -a "$TEST_RESULTS"
|
2021-02-07 17:16:26 +00:00
|
|
|
echo "" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
|
|
|
# "FAILED" and "Exception" are from Crypto++
|
|
|
|
# "ERROR" is from this script
|
|
|
|
# "Error" is from the GNU assembler
|
|
|
|
# "error" is from the sanitizers
|
|
|
|
# "Illegal", "Conditional", "0 errors" and "suppressed errors" are from Valgrind.
|
2017-08-29 12:57:04 +00:00
|
|
|
ECOUNT=$("$GREP" -E '(Error|ERROR|error|FAILED|Illegal|Conditional|CryptoPP::Exception)' $TEST_RESULTS | "$GREP" -v -E '( 0 errors|suppressed errors|error detector|format-security)' | wc -l | "$AWK" '{print $1}')
|
2016-09-23 15:32:14 +00:00
|
|
|
if (( "$ECOUNT" == "0" )); then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "No failures detected" | tee -a "$TEST_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
else
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "$ECOUNT errors detected. See $TEST_RESULTS for details" | tee -a "$TEST_RESULTS"
|
|
|
|
if (( "$ECOUNT" < 16 )); then
|
|
|
|
"$GREP" -n -E '(Error|ERROR|error|FAILED|Illegal|Conditional|CryptoPP::Exception)' "$TEST_RESULTS" | "$GREP" -v -E '( 0 errors|suppressed errors|error detector|Assertion|format-security)'
|
|
|
|
fi
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Report warnings
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "************************************************" | tee -a "$TEST_RESULTS" "$WARN_RESULTS"
|
2021-02-07 17:16:26 +00:00
|
|
|
echo "" | tee -a "$TEST_RESULTS" "$WARN_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
2017-08-29 12:57:04 +00:00
|
|
|
WCOUNT=$("$GREP" -E '(warning:)' $WARN_RESULTS | wc -l | "$AWK" '{print $1}')
|
2016-09-23 15:32:14 +00:00
|
|
|
if (( "$WCOUNT" == "0" )); then
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "No warnings detected" | tee -a "$TEST_RESULTS" "$WARN_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
else
|
2020-05-10 03:16:29 +00:00
|
|
|
echo "$WCOUNT warnings detected. See $WARN_RESULTS for details" | tee -a "$TEST_RESULTS" "$WARN_RESULTS"
|
|
|
|
# "$GREP" -n -E '(warning:)' $WARN_RESULTS | "$GREP" -v 'deprecated-declarations'
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# Report execution time
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "************************************************" | tee -a "$TEST_RESULTS" "$WARN_RESULTS"
|
2021-02-07 17:16:26 +00:00
|
|
|
echo "" | tee -a "$TEST_RESULTS" "$WARN_RESULTS"
|
2016-09-23 15:32:14 +00:00
|
|
|
|
|
|
|
echo "Testing started: $TEST_BEGIN" | tee -a "$TEST_RESULTS" "$WARN_RESULTS"
|
|
|
|
echo "Testing finished: $TEST_END" | tee -a "$TEST_RESULTS" "$WARN_RESULTS"
|
|
|
|
echo
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# http://tldp.org/LDP/abs/html/exitcodes.html#EXITCODESREF
|
|
|
|
if (( "$ECOUNT" == "0" )); then
|
2020-05-10 03:16:29 +00:00
|
|
|
exit 0
|
2016-09-23 15:32:14 +00:00
|
|
|
else
|
2020-05-10 03:16:29 +00:00
|
|
|
exit 1
|
2016-09-23 15:32:14 +00:00
|
|
|
fi
|