]> gcc.gnu.org Git - gcc.git/commitdiff
contrib: Fix nonportable shell syntax in "test" and "[" commands [PR105831]
authorJonathan Wakely <jwakely@redhat.com>
Thu, 18 May 2023 09:18:19 +0000 (10:18 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 18 May 2023 13:01:40 +0000 (14:01 +0100)
POSIX sh does not support the == for string comparisons, use = instead.

These contrib scripts all use a bash shebang so == does work, but
there's no reason they can't just use the more portable form anyway.

PR bootstrap/105831

contrib/ChangeLog:

* bench-stringop: Use = operator instead of ==.
* repro_fail: Likewise.

contrib/reghunt/ChangeLog:

* bin/reg-hunt: Use = operator instead of ==.

contrib/bench-stringop
contrib/reghunt/bin/reg-hunt
contrib/repro_fail

index daf1bce6e6f18ba10ac4722a730bb11e29b357b8..f058e066b3a4f5af5066f1ad21ecbafc5d6f879b 100755 (executable)
@@ -87,7 +87,7 @@ test "$2" "$3" "-mstringop-strategy=rep_byte -malign-stringops" rep1
 test "$2" "$3" "-mstringop-strategy=rep_byte -mno-align-stringops" rep1noalign
 test "$2" "$3" "-mstringop-strategy=rep_4byte -malign-stringops" rep4
 test "$2" "$3" "-mstringop-strategy=rep_4byte -mno-align-stringops" rep4noalign
-if [ "$mode" == 64 ]
+if [ "$mode" = 64 ]
 then
 test "$2" "$3" "-mstringop-strategy=rep_8byte -malign-stringops" rep8
 test "$2" "$3" "-mstringop-strategy=rep_8byte -mno-align-stringops" rep8noalign
@@ -109,7 +109,7 @@ echo "    $best"
 
 test_all_sizes()
 {
-if [ "$mode" == 64 ]
+if [ "$mode" = 64 ]
 then
 echo "  block size  libcall rep1    noalg   rep4    noalg   rep8    noalg   loop    noalg   unrl    noalg   sse     noalg   byte    PGO     dynamic    BEST"
 else
index 6427535dabe1aaf189a4e58ada4c01b36f882d1e..aff4e9005b5fe2fc7e4a9cc238cd2584c26de6f2 100755 (executable)
@@ -142,7 +142,7 @@ process_patch () {
     # build failures, quit now.
 
     if [ ${SKIP} -eq 0 ]; then
-      if [ "x${REG_NEWMID}" == "x" \
+      if [ "x${REG_NEWMID}" = "x" \
            -o ${TEST_ID} -eq ${LATER_THAN} \
            -o ${TEST_ID} -eq ${EARLIER_THAN} ]; then
         error "build failed for ${TEST_ID}"
index 9ea79f2bccfced4217703e4077c2f53177341350..abb479d08aa29cbe9255404fcfd96f061e786610 100755 (executable)
@@ -42,10 +42,10 @@ if [ $# -lt 2 ] ; then
     exit 1
 fi
 
-if [ "$1" == "--debug" ] ; then
+if [ "$1" = "--debug" ] ; then
     debug_args="-wrapper gdb,--args"
     shift
-elif [ "$1" == "--debug-tui" ] ; then
+elif [ "$1" = "--debug-tui" ] ; then
     debug_args="-wrapper gdb,--tui,--args"
     shift
 else
This page took 0.064555 seconds and 5 git commands to generate.