From f56a6a05a8440c85b9f42871b5b0eac6db6240ef Mon Sep 17 00:00:00 2001 From: yzewei Date: Wed, 10 Jan 2024 09:51:15 +0800 Subject: [PATCH] update loong64 for test-go.bats Signed-off-by: yzewei --- src/test-go.bats | 9 ++++++++- src/test_helper.bash | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/test-go.bats b/src/test-go.bats index 6c13c1b..9a9acc8 100755 --- a/src/test-go.bats +++ b/src/test-go.bats @@ -9,7 +9,11 @@ ensureGo() { else add golang fi - add clang lld + if [ "$(xx-info arch)" = "loong64" ]; then + add clang binutils + else + add clang lld + fi } setup_file() { @@ -262,6 +266,9 @@ testHelloGO() { } @test "loong64-hellogo" { + if ! supportLoongArchGo; then + skip "LOONGARCH GO not supported" + fi export TARGETARCH=loong64 testHelloGO } diff --git a/src/test_helper.bash b/src/test_helper.bash index 5e07a07..10ae759 100644 --- a/src/test_helper.bash +++ b/src/test_helper.bash @@ -91,6 +91,10 @@ supportRiscVCGo() { versionGTE "$(go version | awk '{print $3}' | sed 's/^go//')" "1.16" } +supportLoongArchGo() { + versionGTE "$(go version | awk '{print $3}' | sed 's/^go//')" "1.19" +} + supportLoongArch() { if [ -f /etc/debian_version ]; then if grep "sid" /etc/apt/sources.list 2>/dev/null >/dev/null; then