Add code generation tests to cryptest-ios.sh

This commit is contained in:
Jeffrey Walton 2021-03-08 03:14:25 -05:00
parent c55f997922
commit 7a61eb0e81
No known key found for this signature in database
GPG Key ID: B36AB348921B1838

View File

@ -83,6 +83,46 @@ do
# run in subshell to not keep any envars # run in subshell to not keep any envars
( (
source ./setenv-ios.sh source ./setenv-ios.sh
if [[ "${cpu}" == "arm64" ]]
then
# Test AES code generation
if make -f GNUmakefile-cross rijndael_simd.o
then
count=$(otool -tV rijndael_simd.o 2>&1 | grep -i -c -E 'aese|aesd|aesmc|aesimc')
if [[ "${count}" -gt 0 ]]
then
echo "${platform} : AES ==> SUCCESS" >> "${TMPDIR}/build.log"
else
echo "${platform} : AES ==> FAILURE" >> "${TMPDIR}/build.log"
touch "${TMPDIR}/build.failed"
fi
fi
# Test SHA1 and SHA2 code generation
if make -f GNUmakefile-cross sha_simd.o
then
count=$(otool -tV sha_simd.o 2>&1 | grep -i -c -E 'sha1c|sha1m|sha1p|sha1h|sha1su0|sha1su1')
if [[ "${count}" -gt 0 ]]
then
echo "${platform} : SHA1 ==> SUCCESS" >> "${TMPDIR}/build.log"
else
echo "${platform} : SHA1 ==> FAILURE" >> "${TMPDIR}/build.log"
touch "${TMPDIR}/build.failed"
fi
count=$(otool -tV sha_simd.o | grep -i -c -E 'sha256h|sha256su0|sha256su1')
if [[ "${count}" -gt 0 ]]
then
echo "${platform} : SHA2 ==> SUCCESS" >> "${TMPDIR}/build.log"
else
echo "${platform} : SHA2 ==> FAILURE" >> "${TMPDIR}/build.log"
touch "${TMPDIR}/build.failed"
fi
fi
fi
if make -k -j "${MAKE_JOBS}" -f GNUmakefile-cross static dynamic cryptest.exe; if make -k -j "${MAKE_JOBS}" -f GNUmakefile-cross static dynamic cryptest.exe;
then then
echo "${platform} ==> SUCCESS" >> "${TMPDIR}/build.log" echo "${platform} ==> SUCCESS" >> "${TMPDIR}/build.log"