Skip to content

Commit 92fb0a0

Browse files
Vladimir Stefanovicbradfitz
Vladimir Stefanovic
authored andcommitted
misc/cgo/test: add mipsx test case for #9400
Change-Id: I7d0bc5093943b0744d865e91517ff6292f3b2f89 Reviewed-on: https://go-review.googlesource.com/34510 Run-TryBot: Cherry Zhang <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]>
1 parent 01b006f commit 92fb0a0

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

misc/cgo/test/issue9400/asm_mipsx.s

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2016 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
// +build mips mipsle
6+
// +build !gccgo
7+
8+
#include "textflag.h"
9+
10+
TEXT ·RewindAndSetgid(SB),NOSPLIT,$-4-0
11+
// Rewind stack pointer so anything that happens on the stack
12+
// will clobber the test pattern created by the caller
13+
ADDU $(1024*8), R29
14+
15+
// Ask signaller to setgid
16+
MOVW $1, R1
17+
SYNC
18+
MOVW R1, ·Baton(SB)
19+
SYNC
20+
21+
// Wait for setgid completion
22+
loop:
23+
SYNC
24+
MOVW ·Baton(SB), R1
25+
OR R2, R2, R2 // hint that we're in a spin loop
26+
BNE R1, loop
27+
SYNC
28+
29+
// Restore stack
30+
ADDU $(-1024*8), R29
31+
RET

0 commit comments

Comments
 (0)