summaryrefslogtreecommitdiff
path: root/gold/testsuite
diff options
context:
space:
mode:
authorRahul Chaudhry <rahulchaudhry@google.com>2017-01-23 17:34:14 -0800
committerCary Coutant <ccoutant@gmail.com>2017-01-23 17:34:42 -0800
commit741bcbe94d7811caa1efa500dacd047c428cce61 (patch)
treecbb7ae04d214d029bc9e58080daf615b09df3cd2 /gold/testsuite
parentfbf32f638c7e2a80542cb90626a22a6b5bb3e580 (diff)
downloadbinutils-gdb-741bcbe94d7811caa1efa500dacd047c428cce61.tar.gz
Add -e to test scripts where necessary.
gold/ * testsuite/icf_safe_so_test.sh: Use "set -e". * testsuite/icf_safe_test.sh: Likewise. * testsuite/icf_test.sh: Likewise.
Diffstat (limited to 'gold/testsuite')
-rwxr-xr-xgold/testsuite/icf_safe_so_test.sh5
-rwxr-xr-xgold/testsuite/icf_safe_test.sh5
-rwxr-xr-xgold/testsuite/icf_test.sh2
3 files changed, 8 insertions, 4 deletions
diff --git a/gold/testsuite/icf_safe_so_test.sh b/gold/testsuite/icf_safe_so_test.sh
index 6542c65d566..28600be5615 100755
--- a/gold/testsuite/icf_safe_so_test.sh
+++ b/gold/testsuite/icf_safe_so_test.sh
@@ -27,6 +27,8 @@
# to verify if identical code folding in safe mode correctly folds
# functions in a shared object.
+set -e
+
error_if_symbol_absent()
{
if ! is_symbol_present $1 $2;
@@ -84,8 +86,7 @@ END {
arch_specific_safe_fold()
{
- grep -e "Intel 80386" -e "ARM" -e "PowerPC" $1 > /dev/null 2>&1
- if [ $? -eq 0 ];
+ if grep -q -e "Intel 80386" -e "ARM" -e "PowerPC" $1;
then
check_fold $2 $4 $5 $3
else
diff --git a/gold/testsuite/icf_safe_test.sh b/gold/testsuite/icf_safe_test.sh
index 47650162c42..f048d8617d8 100755
--- a/gold/testsuite/icf_safe_test.sh
+++ b/gold/testsuite/icf_safe_test.sh
@@ -27,6 +27,8 @@
# ctors and dtors are folded, except for x86 (32 and 64 bit), which
# uses relocation types to detect if function pointers are taken.
+set -e
+
check_nofold()
{
func_addr_1=`grep $2 $1 | awk '{print $1}'`
@@ -57,8 +59,7 @@ END {
arch_specific_safe_fold()
{
- grep_x86=`grep -q -e "Advanced Micro Devices X86-64" -e "Intel 80386" -e "ARM" -e "TILE" -e "PowerPC" -e "AArch64" -e "IBM S/390" $2`
- if [ $? -eq 0 ];
+ if grep -q -e "Advanced Micro Devices X86-64" -e "Intel 80386" -e "ARM" -e "TILE" -e "PowerPC" -e "AArch64" -e "IBM S/390" $2;
then
check_fold $3 $4 $5
else
diff --git a/gold/testsuite/icf_test.sh b/gold/testsuite/icf_test.sh
index 3d11dcb8083..2e7fd9d7093 100755
--- a/gold/testsuite/icf_test.sh
+++ b/gold/testsuite/icf_test.sh
@@ -26,6 +26,8 @@
# File icf_test.cc is in this test. This program checks if the
# identical sections are correctly folded.
+set -e
+
check()
{
awk "