]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal: fix test error on loong64
authorXiaodong Liu <liuxiaodong@loongson.cn>
Thu, 25 Nov 2021 06:20:39 +0000 (14:20 +0800)
committerGopher Robot <gobot@golang.org>
Tue, 12 Apr 2022 02:20:36 +0000 (02:20 +0000)
For TestLogOpt test case, add loong64 support to test the host
architecture and os.

The Ctz64 is not intrinsified on loong64 for TestIntendedInlining.

Contributors to the loong64 port are:
  Weining Lu <luweining@loongson.cn>
  Lei Wang <wanglei@loongson.cn>
  Lingqin Gong <gonglingqin@loongson.cn>
  Xiaolin Zhao <zhaoxiaolin@loongson.cn>
  Meidan Li <limeidan@loongson.cn>
  Xiaojuan Zhai <zhaixiaojuan@loongson.cn>
  Qiyuan Pu <puqiyuan@loongson.cn>
  Guoqi Chen <chenguoqi@loongson.cn>

This port has been updated to Go 1.15.6:
  https://github.com/loongson/go

Updates #46229

Change-Id: I4ca290bf725425a9a6ac2c6767a5bf4ff2339d0e
Reviewed-on: https://go-review.googlesource.com/c/go/+/367043
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>

src/cmd/compile/internal/logopt/logopt_test.go
src/cmd/compile/internal/test/inl_test.go

index 8d07a49cc0fd6041ccf8722193718c0e905d7afa..411319f9e9eff6e903b2b654b895df5116588f13 100644 (file)
@@ -155,7 +155,7 @@ func s15a8(x *[15]int64) [15]int64 {
                arches := []string{runtime.GOARCH}
                goos0 := runtime.GOOS
                if runtime.GOARCH == "amd64" { // Test many things with "linux" (wasm will get "js")
-                       arches = []string{"arm", "arm64", "386", "amd64", "mips", "mips64", "ppc64le", "riscv64", "s390x", "wasm"}
+                       arches = []string{"arm", "arm64", "386", "amd64", "mips", "mips64", "loong64", "ppc64le", "riscv64", "s390x", "wasm"}
                        goos0 = "linux"
                }
 
index b10d37a17cfd0d242775b60ece9eaed8b30bfbb0..9e93cdd0c56a538d926c5cc18e57fbbd0d54cdf8 100644 (file)
@@ -163,10 +163,10 @@ func TestIntendedInlining(t *testing.T) {
                },
        }
 
-       if runtime.GOARCH != "386" && runtime.GOARCH != "mips64" && runtime.GOARCH != "mips64le" && runtime.GOARCH != "riscv64" {
+       if runtime.GOARCH != "386" && runtime.GOARCH != "loong64" && runtime.GOARCH != "mips64" && runtime.GOARCH != "mips64le" && runtime.GOARCH != "riscv64" {
                // nextFreeFast calls sys.Ctz64, which on 386 is implemented in asm and is not inlinable.
                // We currently don't have midstack inlining so nextFreeFast is also not inlinable on 386.
-               // On mips64x and riscv64, Ctz64 is not intrinsified and causes nextFreeFast too expensive
+               // On loong64, mips64x and riscv64, Ctz64 is not intrinsified and causes nextFreeFast too expensive
                // to inline (Issue 22239).
                want["runtime"] = append(want["runtime"], "nextFreeFast")
        }