Add -e to test scripts where necessary.
authorRahul Chaudhry <rahulchaudhry@google.com>
Tue, 24 Jan 2017 01:34:14 +0000 (17:34 -0800)
committerCary Coutant <ccoutant@gmail.com>
Tue, 24 Jan 2017 01:34:42 +0000 (17:34 -0800)
gold/
        * testsuite/icf_safe_so_test.sh: Use "set -e".
        * testsuite/icf_safe_test.sh: Likewise.
        * testsuite/icf_test.sh: Likewise.

gold/ChangeLog
gold/testsuite/icf_safe_so_test.sh
gold/testsuite/icf_safe_test.sh
gold/testsuite/icf_test.sh

index d98ff0ba654fed7417b24e4a3dc41f9b54405b78..7357c08a03a756b07e7dfadcdc211d612aa1ebe0 100644 (file)
@@ -1,3 +1,9 @@
+2017-01-23  Rahul Chaudhry  <rahulchaudhry@google.com>
+
+        * testsuite/icf_safe_so_test.sh: Use "set -e".
+        * testsuite/icf_safe_test.sh: Likewise.
+        * testsuite/icf_test.sh: Likewise.
+
 2017-01-23  Vladimir Radosavljevic  <Vladimir.Radosavljevic@imgtec.com>
 
        * mips.cc (Mips_output_data_plt::rel_plt): Remove const from return
index 6542c65d5666dde0b2401e4d5f4f8651a0e3599d..28600be561552bf5ea4e6bec5075093a29501abb 100755 (executable)
@@ -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
index 47650162c42212dc27769b238b41b2257d8c0a17..f048d8617d85b7b9b35c7517e3d29e0fd93a2cce 100755 (executable)
@@ -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
index 3d11dcb8083fb36e8c567ea9cc8047be7fcce02f..2e7fd9d7093268a753befef9659d7a28e6b32e4a 100755 (executable)
@@ -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 "
This page took 0.025939 seconds and 4 git commands to generate.