Allow gcc-15 to be in $PATH

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/tests/scripts/components-compiler.sh b/tests/scripts/components-compiler.sh
index 0110d70..e0dfe49 100644
--- a/tests/scripts/components-compiler.sh
+++ b/tests/scripts/components-compiler.sh
@@ -81,7 +81,13 @@
 # For the time being, we don't make $GCC_LATEST be GCC 15 on the CI
 # platform, because that would break branches where #9814 isn'f fixed yet.
 support_test_gcc15_drivers_opt () {
-    test -x /usr/local/gcc-15/bin/gcc-15
+    if type gcc-15 >/dev/null 2>/dev/null; then
+        GCC_15=gcc-15
+    elif [ -x /usr/local/gcc-15/bin/gcc-15 ]; then
+        GCC_15=/usr/local/gcc-15/bin/gcc-15
+    else
+        return 1
+    fi
 }
 component_test_gcc15_drivers_opt () {
     msg "build: GCC 15: full + test drivers dispatching to builtins"
@@ -94,7 +100,7 @@
     # Also disable a warning that we don't yet comply to.
     loc_cflags="${loc_cflags} -Wno-error=unterminated-string-initialization"
 
-    make CC=/usr/local/gcc-15/bin/gcc-15 CFLAGS="${loc_cflags}" LDFLAGS="$ASAN_CFLAGS"
+    make CC=$GCC_15 CFLAGS="${loc_cflags}" LDFLAGS="$ASAN_CFLAGS"
 
     msg "test: GCC 15: full + test drivers dispatching to builtins"
     make test