]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc: 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:35 +0000 (14:01 +0100)
POSIX sh does not support the == for string comparisons, use = instead.

The gen_directive_tests script uses a bash shebang so == does work, but
there's no reason this script can't just use the more portable form
anyway.

PR bootstrap/105831

gcc/ChangeLog:

* config.gcc: Use = operator instead of ==.

gcc/testsuite/ChangeLog:

* gcc.test-framework/gen_directive_tests: Use = operator instead
of ==.

gcc/config.gcc
gcc/testsuite/gcc.test-framework/gen_directive_tests

index e08c67d7cde1889a31bf0724df19a93c20d655da..d88071773c9e1280cc5f38e36e09573214323b48 100644 (file)
@@ -2441,7 +2441,7 @@ riscv*-*-elf* | riscv*-*-rtems*)
          tmake_file="${tmake_file} riscv/t-rtems"
          ;;
        *)
-         if test "x${with_multilib_generator}" == xdefault; then
+         if test "x${with_multilib_generator}" = xdefault; then
                  case "x${enable_multilib}" in
                  xno) ;;
                  xyes) tmake_file="${tmake_file} riscv/t-elf-multilib" ;;
index 29f0a734877b794176617b5e8eadcba68e6a4395..1cfc8432f60c106adb33274bba2f820246e52575 100644 (file)
@@ -283,8 +283,8 @@ one() {
     echo "${GOOD_PROG}" >> $FILE1
     echo "${GOOD_PROG}" > $FILE2
 
-    if [ "${FAIL_VERSION}" == "yes" ]; then
-       if [ "${EXP}" == "${EXP_PASS}" ]; then
+    if [ "${FAIL_VERSION}" = "yes" ]; then
+       if [ "${EXP}" = "${EXP_PASS}" ]; then
            NAME=${KIND}-${EXP_FAIL}
        else
            NAME=${KIND}-${EXP_XFAIL}
@@ -322,8 +322,8 @@ two() {
     echo "${GOOD_PROG}" >> $FILE1
     echo "${GOOD_PROG}" > $FILE2
 
-    if [ "${FAIL_VERSION}" == "yes" ]; then
-       if [ "${EXP}" == "${EXP_PASS}" ]; then
+    if [ "${FAIL_VERSION}" = "yes" ]; then
+       if [ "${EXP}" = "${EXP_PASS}" ]; then
            NAME=${KIND1}-${KIND2}-${EXP_FAIL}
        else
            NAME=${KIND1}-${KIND2}-${EXP_XFAIL}
@@ -364,8 +364,8 @@ three() {
     echo "${GOOD_PROG}" >> $FILE1
     echo "${GOOD_PROG}" > $FILE2
 
-    if [ "${FAIL_VERSION}" == "${yes}" ]; then
-       if [ "${EXP}" == "${EXP_PASS}" ]; then
+    if [ "${FAIL_VERSION}" = "${yes}" ]; then
+       if [ "${EXP}" = "${EXP_PASS}" ]; then
            NAME=${KIND1}-${KIND2}-${KIND3}-${EXP_FAIL}
        else
            NAME=${KIND1}-${KIND2}-${KIND3}-${EXP_XFAIL}