From 864ecda59e8050baf2aa3a5ce3d329613c227f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bence=20Sz=C3=A9pk=C3=BAti?= Date: Thu, 11 Jul 2024 15:52:07 +0100 Subject: [PATCH] Add AArch64 default config test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bence Szépkúti --- tests/scripts/all-core.sh | 1 + tests/scripts/all-helpers.sh | 20 ++++++++++++++++++++ tests/scripts/components-platform.sh | 19 +++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/tests/scripts/all-core.sh b/tests/scripts/all-core.sh index bd0cadd865..32c5aaab1d 100644 --- a/tests/scripts/all-core.sh +++ b/tests/scripts/all-core.sh @@ -228,6 +228,7 @@ pre_initialize_variables () { : ${ARM_NONE_EABI_GCC_PREFIX:=arm-none-eabi-} : ${ARM_LINUX_GNUEABI_GCC_PREFIX:=arm-linux-gnueabi-} : ${ARM_LINUX_GNUEABIHF_GCC_PREFIX:=arm-linux-gnueabihf-} + : ${AARCH64_LINUX_GNU_GCC_PREFIX:=aarch64-linux-gnu-} : ${CLANG_LATEST:="clang-latest"} : ${CLANG_EARLIEST:="clang-earliest"} : ${GCC_LATEST:="gcc-latest"} diff --git a/tests/scripts/all-helpers.sh b/tests/scripts/all-helpers.sh index 9ecf63d174..06a9247324 100644 --- a/tests/scripts/all-helpers.sh +++ b/tests/scripts/all-helpers.sh @@ -266,6 +266,15 @@ clang_version() { fi } +gcc_version() { + cc="$1" + if command -v clang > /dev/null ; then + "$cc" --version | sed -En '1s/^[^ ]* \([^)]*\) ([0-9]+).*/\1/p' + else + echo 0 # report version 0 for "no clang" + fi +} + can_run_cc_output() { cc="$1" result=1 @@ -302,3 +311,14 @@ can_run_arm_linux_gnueabihf () { fi return $((! can_run_arm_linux_gnueabihf)) } + +can_run_aarch64_linux_gnu () { + if [ -z "${can_run_aarch64_linux_gnu:-}" ]; then + if can_run_cc_output "${AARCH64_LINUX_GNU_GCC_PREFIX}gcc"; then + can_run_aarch64_linux_gnu=1 + else + can_run_aarch64_linux_gnu=0 + fi + fi + return $((! can_run_aarch64_linux_gnu)) +} diff --git a/tests/scripts/components-platform.sh b/tests/scripts/components-platform.sh index 0e0e2c66fc..dc9059066c 100644 --- a/tests/scripts/components-platform.sh +++ b/tests/scripts/components-platform.sh @@ -432,6 +432,25 @@ support_test_arm_linux_gnueabihf_gcc_thumb_2 () { can_run_arm_linux_gnueabihf } +component_test_aarch64_linux_gnu_gcc () { + msg "test: ${AARCH64_LINUX_GNU_GCC_PREFIX}gcc -O2, default config" + make clean + make CC="${AARCH64_LINUX_GNU_GCC_PREFIX}gcc" CFLAGS='-std=c99 -Werror -Wextra -O2' + + msg "test: main suites make, default config (out-of-box)" # ~10s + make test + + msg "selftest: make, default config (out-of-box)" # ~10s + programs/test/selftest + + msg "program demos: make, default config (out-of-box)" # ~10s + tests/scripts/run_demos.py +} + +support_test_aarch64_linux_gnu_gcc () { + [ "$(gcc_version "${AARCH64_LINUX_GNU_GCC_PREFIX}gcc")" -ge 6 ] && can_run_aarch64_linux_gnu +} + component_build_arm_none_eabi_gcc () { msg "build: ${ARM_NONE_EABI_GCC_PREFIX}gcc -O1, baremetal+debug" # ~ 10s scripts/config.py baremetal