From 65984d31e6ffa0ad079505b2f17be416f36fc0db Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Mon, 22 Aug 2016 03:03:59 -0400 Subject: [PATCH] Remove duplicate dead code stripping --- cryptest.sh | 82 ++++++++--------------------------------------------- 1 file changed, 12 insertions(+), 70 deletions(-) diff --git a/cryptest.sh b/cryptest.sh index bb403496..921b14c4 100755 --- a/cryptest.sh +++ b/cryptest.sh @@ -439,25 +439,25 @@ if [[ (-z "$HAVE_OMP") ]]; then "$CXX" -DCRYPTOPP_ADHOC_MAIN -fopenmp -O3 adhoc.cpp -o "$TMP/adhoc.exe" > /dev/null 2>&1 if [[ "$?" -eq "0" ]]; then HAVE_OMP=1 - OMP_FLAG=(-fopenmp -O3) + OMP_FLAGS=(-fopenmp -O3) fi elif [[ "$INTEL_COMPILER" -ne "0" ]]; then "$CXX" -DCRYPTOPP_ADHOC_MAIN -openmp -O3 adhoc.cpp -o "$TMP/adhoc.exe" > /dev/null 2>&1 if [[ "$?" -eq "0" ]]; then HAVE_OMP=1 - OMP_FLAG=(-openmp -O3) + OMP_FLAGS=(-openmp -O3) fi elif [[ "$CLANG_COMPILER" -ne "0" ]]; then "$CXX" -DCRYPTOPP_ADHOC_MAIN -fopenmp=libomp -O3 adhoc.cpp -o "$TMP/adhoc.exe" > /dev/null 2>&1 if [[ "$?" -eq "0" ]]; then HAVE_OMP=1 - OMP_FLAG=(-fopenmp=libomp -O3) + OMP_FLAGS=(-fopenmp=libomp -O3) fi elif [[ "$SUN_COMPILER" -ne "0" ]]; then "$CXX" -DCRYPTOPP_ADHOC_MAIN -xopenmp=parallel -xO3 adhoc.cpp -o "$TMP/adhoc.exe" > /dev/null 2>&1 if [[ "$?" -eq "0" ]]; then HAVE_OMP=1 - OMP_FLAG=(-xopenmp=parallel -xO3) + OMP_FLAGS=(-xopenmp=parallel -xO3) fi fi fi @@ -765,9 +765,7 @@ fi # Tools available for testing echo | tee -a "$TEST_RESULTS" -if [[ (! -z "$HAVE_OMP") ]]; then - echo "HAVE_OMP: $HAVE_OMP" | tee -a "$TEST_RESULTS" -fi +if [[ ((! -z "$HAVE_OMP") && ("$HAVE_OMP" -ne "0")) ]]; then echo "HAVE_OMP: $HAVE_OMP" | tee -a "$TEST_RESULTS"; fi echo "HAVE_ASAN: $HAVE_ASAN" | tee -a "$TEST_RESULTS" if [[ ("$HAVE_ASAN" -ne "0") && (! -z "$ASAN_SYMBOLIZE") ]]; then echo "ASAN_SYMBOLIZE: $ASAN_SYMBOLIZE" | tee -a "$TEST_RESULTS"; fi echo "HAVE_UBSAN: $HAVE_UBSAN" | tee -a "$TEST_RESULTS" @@ -2376,8 +2374,11 @@ if [[ "$HAVE_OFAST" -ne "0" ]]; then fi ############################################ -# Debug build, dead code strip +# Dead code stripping if [[ ("$SUN_COMPILER" -eq "0") ]]; then + + ############################################ + # Debug build echo echo "************************************" | tee -a "$TEST_RESULTS" echo "Testing: Debug, dead code strip" | tee -a "$TEST_RESULTS" @@ -2401,68 +2402,9 @@ if [[ ("$SUN_COMPILER" -eq "0") ]]; then echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS" fi fi -fi -############################################ -# Release build, dead code strip -if [[ ("$SUN_COMPILER" -eq "0") ]]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: Release, dead code strip" | tee -a "$TEST_RESULTS" - echo - - "$MAKE" clean > /dev/null 2>&1 - rm -f adhoc.cpp > /dev/null 2>&1 - - CXXFLAGS="$RELEASE_CXXFLAGS ${PLATFORM_CXXFLAGS[@]} $USER_CXXFLAGS ${DEPRECATED_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 -fi - -*** -############################################ -# Debug build, dead code strip -if [[ ("$SUN_COMPILER" -eq "0") ]]; then - echo - echo "************************************" | tee -a "$TEST_RESULTS" - echo "Testing: Debug, dead code strip" | tee -a "$TEST_RESULTS" - echo - - "$MAKE" clean > /dev/null 2>&1 - rm -f adhoc.cpp > /dev/null 2>&1 - - CXXFLAGS="$DEBUG_CXXFLAGS ${PLATFORM_CXXFLAGS[@]} $USER_CXXFLAGS ${DEPRECATED_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 -fi - -############################################ -# Release build, dead code strip -if [[ ("$SUN_COMPILER" -eq "0") ]]; then + ############################################ + # Release build echo echo "************************************" | tee -a "$TEST_RESULTS" echo "Testing: Release, dead code strip" | tee -a "$TEST_RESULTS" @@ -2499,7 +2441,7 @@ if [[ ("$HAVE_OMP" -ne "0") ]]; then "$MAKE" clean > /dev/null 2>&1 rm -f adhoc.cpp > /dev/null 2>&1 - CXXFLAGS="${OMP_FLAG[@]} ${PLATFORM_CXXFLAGS[@]} $USER_CXXFLAGS ${DEPRECATED_CXXFLAGS[@]}" + CXXFLAGS="-DNDEBUG ${OMP_FLAGS[@]} ${PLATFORM_CXXFLAGS[@]} $USER_CXXFLAGS ${DEPRECATED_CXXFLAGS[@]}" CXX="$CXX" CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" ubsan | tee -a "$TEST_RESULTS" if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then