diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2023-05-18 10:18:19 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2023-05-18 14:01:35 +0100 |
commit | 6e2fbe4f345f48ae3c8ba5bfbc1a7b783b398614 (patch) | |
tree | 38c647683d9716901f2b5fd638073d2c3f48f046 /gcc | |
parent | 95b93adcac69536bab617e045149719ec69099ae (diff) | |
download | gcc-6e2fbe4f345f48ae3c8ba5bfbc1a7b783b398614.zip gcc-6e2fbe4f345f48ae3c8ba5bfbc1a7b783b398614.tar.gz gcc-6e2fbe4f345f48ae3c8ba5bfbc1a7b783b398614.tar.bz2 |
gcc: Fix nonportable shell syntax in "test" and "[" commands [PR105831]
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 ==.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config.gcc | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.test-framework/gen_directive_tests | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc index e08c67d..d880717 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -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" ;; diff --git a/gcc/testsuite/gcc.test-framework/gen_directive_tests b/gcc/testsuite/gcc.test-framework/gen_directive_tests index 29f0a73..1cfc843 100644 --- a/gcc/testsuite/gcc.test-framework/gen_directive_tests +++ b/gcc/testsuite/gcc.test-framework/gen_directive_tests @@ -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} |