]> Cypherpunks.ru repositories - gostls13.git/commitdiff
misc, test: fix test error for loong64
authorXiaodong Liu <liuxiaodong@loongson.cn>
Thu, 19 May 2022 12:01:10 +0000 (20:01 +0800)
committerDavid Chase <drchase@google.com>
Fri, 20 May 2022 16:16:37 +0000 (16:16 +0000)
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: I6760b4a7e51646773cd0f48baa1baba01b213b7d
Reviewed-on: https://go-review.googlesource.com/c/go/+/342325
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

misc/cgo/test/testdata/issue9400/asm_loong64.s [new file with mode: 0644]
test/intrinsic_atomic.go
test/nosplit.go
test/run.go

diff --git a/misc/cgo/test/testdata/issue9400/asm_loong64.s b/misc/cgo/test/testdata/issue9400/asm_loong64.s
new file mode 100644 (file)
index 0000000..c242fc6
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "textflag.h"
+
+TEXT ·RewindAndSetgid(SB),NOSPLIT|NOFRAME,$0-0
+       // Rewind stack pointer so anything that happens on the stack
+       // will clobber the test pattern created by the caller
+       ADDV    $(1024*8), R3
+
+       // Ask signaller to setgid
+       MOVW    $1, R12
+       DBAR
+       MOVW    R12, ·Baton(SB)
+       DBAR
+
+       // Wait for setgid completion
+loop:
+       DBAR
+       MOVW    ·Baton(SB), R12
+       OR      R13, R13, R13   // hint that we're in a spin loop
+       BNE     R12, loop
+       DBAR
+
+       // Restore stack
+       ADDV    $(-1024*8), R3
+       RET
index 61911b7a46e2ed2036d48be83fc0ad82a76b9a92..a1004c89d9538d5bc7371f6064058c00f33296a9 100644 (file)
@@ -1,5 +1,5 @@
 // errorcheck -0 -d=ssa/intrinsics/debug
-// +build amd64 arm64 mips mipsle mips64 mips64le ppc64 ppc64le riscv64 s390x
+// +build amd64 arm64 loong64 mips mipsle mips64 mips64le ppc64 ppc64le riscv64 s390x
 
 // Copyright 2016 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 9cedb93ec360436c045af5291c724d19eba7126d..218eb73727affe9739bd1a9830d3f479eb425315 100644 (file)
@@ -284,6 +284,9 @@ TestCases:
                case "mips64", "mips64le":
                        ptrSize = 8
                        fmt.Fprintf(&buf, "#define REGISTER (R0)\n")
+               case "loong64":
+                       ptrSize = 8
+                       fmt.Fprintf(&buf, "#define REGISTER (R0)\n")
                case "ppc64", "ppc64le":
                        ptrSize = 8
                        fmt.Fprintf(&buf, "#define REGISTER (CTR)\n")
index 7553302a766726b85fadcf8784d6aa001e861cee..cb1622ccc9763d3504ce09efce109ea72662e2c4 100644 (file)
@@ -1585,6 +1585,7 @@ var (
                "amd64":   {"GOAMD64", "v1", "v2", "v3", "v4"},
                "arm":     {"GOARM", "5", "6", "7"},
                "arm64":   {},
+               "loong64": {},
                "mips":    {"GOMIPS", "hardfloat", "softfloat"},
                "mips64":  {"GOMIPS64", "hardfloat", "softfloat"},
                "ppc64":   {"GOPPC64", "power8", "power9"},