]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
contrib/regression/btest-gcc.sh: Handle multiple options.
authorHans-Peter Nilsson <hp@axis.com>
Wed, 22 Nov 2023 17:11:13 +0000 (18:11 +0100)
committerHans-Peter Nilsson <hp@bitrange.com>
Thu, 23 Nov 2023 23:20:42 +0000 (00:20 +0100)
This is a long-standing bug: passing "-j --add-passes-despite-regression"
or "--add-passes-despite-regression -j" caused the second option to be
treated as TARGET; the first non-option parameter.

* btest-gcc.sh (Option handling): Handle multiple options.

contrib/regression/btest-gcc.sh

index 1808fcc392faf76332117ad23fe35be7c9da183f..22e8f0398662ecfda317b79c475a57df73c95b54 100755 (executable)
@@ -29,13 +29,16 @@ dashj=''
 # -j<n>:
 #  Pass '-j<n>' to make.
 
-case "$1" in
- --add-passes-despite-regression)
-  add_passes_despite_regression=1; shift;;
- -j*)
-  dashj=$1; shift;;
- -*) echo "Invalid option: $1"; exit 2;;
-esac
+while : ; do
+  case "$1" in
+   --add-passes-despite-regression)
+    add_passes_despite_regression=1; shift;;
+   -j*)
+    dashj=$1; shift;;
+   -*) echo "Invalid option: $1"; exit 2;;
+   *) break;;
+  esac
+done
 
 # TARGET is the target triplet.  It should be the same one as used in
 # constructing PREFIX.  Or it can be the keyword 'native', indicating