annotate libgo/misc/cgo/test/issue9400/gccgo.go @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // Copyright 2014 The Go Authors. All rights reserved.
kono
parents:
diff changeset
2 // Use of this source code is governed by a BSD-style
kono
parents:
diff changeset
3 // license that can be found in the LICENSE file.
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 // +build gccgo
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 package issue9400
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 import (
kono
parents:
diff changeset
10 "runtime"
kono
parents:
diff changeset
11 "sync/atomic"
kono
parents:
diff changeset
12 )
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 // The test for the gc compiler resets the stack pointer so that the
kono
parents:
diff changeset
15 // stack gets modified. We don't have a way to do that for gccgo
kono
parents:
diff changeset
16 // without writing more assembly code, which we haven't bothered to
kono
parents:
diff changeset
17 // do. So this is not much of a test.
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 func RewindAndSetgid() {
kono
parents:
diff changeset
20 atomic.StoreInt32(&Baton, 1)
kono
parents:
diff changeset
21 for atomic.LoadInt32(&Baton) != 0 {
kono
parents:
diff changeset
22 runtime.Gosched()
kono
parents:
diff changeset
23 }
kono
parents:
diff changeset
24 }