all.sh: move clang_version() to helpers file
This function is only used in (a few) components, it's not part of the core.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
diff --git a/tests/scripts/all-helpers.sh b/tests/scripts/all-helpers.sh
index b165042..de7c078 100644
--- a/tests/scripts/all-helpers.sh
+++ b/tests/scripts/all-helpers.sh
@@ -249,3 +249,11 @@
"$ARMC6_FROMELF" -z ${BUILTIN_SRC_PATH}/*.o
fi
}
+
+clang_version() {
+ if command -v clang > /dev/null ; then
+ clang --version|grep version|sed -E 's#.*version ([0-9]+).*#\1#'
+ else
+ echo 0 # report version 0 for "no clang"
+ fi
+}