diff --git a/src/test-go.bats b/src/test-go.bats index 6c13c1b..7480e78 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() { @@ -119,9 +123,6 @@ testEnv() { } @test "loong64-env" { - if ! supportLoongArch; then - skip "LoongArch GO not supported" - fi export TARGETARCH=loong64 testEnv } @@ -262,6 +263,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