aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/sync
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2013-01-29 20:52:43 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2013-01-29 20:52:43 +0000
commitd6f2922e91928b5191a5c5f1b3a6b320712b5ce3 (patch)
tree4f2fad1f4b778519bdd5941185c7e1d032af055b /libgo/go/sync
parent91bfca59095b1cca9d4364996866848eaaf76c26 (diff)
downloadgcc-d6f2922e91928b5191a5c5f1b3a6b320712b5ce3.zip
gcc-d6f2922e91928b5191a5c5f1b3a6b320712b5ce3.tar.gz
gcc-d6f2922e91928b5191a5c5f1b3a6b320712b5ce3.tar.bz2
libgo: Update Go library to master revision 15489/921e53d4863c.
From-SVN: r195560
Diffstat (limited to 'libgo/go/sync')
-rw-r--r--libgo/go/sync/atomic/atomic_test.go45
-rw-r--r--libgo/go/sync/atomic/doc.go7
2 files changed, 20 insertions, 32 deletions
diff --git a/libgo/go/sync/atomic/atomic_test.go b/libgo/go/sync/atomic/atomic_test.go
index 53dfdbf40..25be63b 100644
--- a/libgo/go/sync/atomic/atomic_test.go
+++ b/libgo/go/sync/atomic/atomic_test.go
@@ -82,8 +82,7 @@ func TestAddUint32(t *testing.T) {
func TestAddInt64(t *testing.T) {
if test64err != nil {
- t.Logf("Skipping 64-bit tests: %v", test64err)
- return
+ t.Skipf("Skipping 64-bit tests: %v", test64err)
}
var x struct {
before int64
@@ -107,8 +106,7 @@ func TestAddInt64(t *testing.T) {
func TestAddUint64(t *testing.T) {
if test64err != nil {
- t.Logf("Skipping 64-bit tests: %v", test64err)
- return
+ t.Skipf("Skipping 64-bit tests: %v", test64err)
}
var x struct {
before uint64
@@ -213,8 +211,7 @@ func TestCompareAndSwapUint32(t *testing.T) {
func TestCompareAndSwapInt64(t *testing.T) {
if test64err != nil {
- t.Logf("Skipping 64-bit tests: %v", test64err)
- return
+ t.Skipf("Skipping 64-bit tests: %v", test64err)
}
var x struct {
before int64
@@ -246,8 +243,7 @@ func TestCompareAndSwapInt64(t *testing.T) {
func TestCompareAndSwapUint64(t *testing.T) {
if test64err != nil {
- t.Logf("Skipping 64-bit tests: %v", test64err)
- return
+ t.Skipf("Skipping 64-bit tests: %v", test64err)
}
var x struct {
before uint64
@@ -381,8 +377,7 @@ func TestLoadUint32(t *testing.T) {
func TestLoadInt64(t *testing.T) {
if test64err != nil {
- t.Logf("Skipping 64-bit tests: %v", test64err)
- return
+ t.Skipf("Skipping 64-bit tests: %v", test64err)
}
var x struct {
before int64
@@ -405,8 +400,7 @@ func TestLoadInt64(t *testing.T) {
func TestLoadUint64(t *testing.T) {
if test64err != nil {
- t.Logf("Skipping 64-bit tests: %v", test64err)
- return
+ t.Skipf("Skipping 64-bit tests: %v", test64err)
}
var x struct {
before uint64
@@ -515,8 +509,7 @@ func TestStoreUint32(t *testing.T) {
func TestStoreInt64(t *testing.T) {
if test64err != nil {
- t.Logf("Skipping 64-bit tests: %v", test64err)
- return
+ t.Skipf("Skipping 64-bit tests: %v", test64err)
}
var x struct {
before int64
@@ -540,8 +533,7 @@ func TestStoreInt64(t *testing.T) {
func TestStoreUint64(t *testing.T) {
if test64err != nil {
- t.Logf("Skipping 64-bit tests: %v", test64err)
- return
+ t.Skipf("Skipping 64-bit tests: %v", test64err)
}
var x struct {
before uint64
@@ -840,8 +832,7 @@ func hammerCompareAndSwapPointer64(uaddr *uint64, count int) {
func TestHammer64(t *testing.T) {
if test64err != nil {
- t.Logf("Skipping 64-bit tests: %v", test64err)
- return
+ t.Skipf("Skipping 64-bit tests: %v", test64err)
}
const p = 4
n := 100000
@@ -1013,8 +1004,7 @@ func TestHammerStoreLoad(t *testing.T) {
func TestStoreLoadSeqCst32(t *testing.T) {
if runtime.NumCPU() == 1 {
- t.Logf("Skipping test on %v processor machine", runtime.NumCPU())
- return
+ t.Skipf("Skipping test on %v processor machine", runtime.NumCPU())
}
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4))
N := int32(1e3)
@@ -1054,12 +1044,10 @@ func TestStoreLoadSeqCst32(t *testing.T) {
func TestStoreLoadSeqCst64(t *testing.T) {
if runtime.NumCPU() == 1 {
- t.Logf("Skipping test on %v processor machine", runtime.NumCPU())
- return
+ t.Skipf("Skipping test on %v processor machine", runtime.NumCPU())
}
if test64err != nil {
- t.Logf("Skipping 64-bit tests: %v", test64err)
- return
+ t.Skipf("Skipping 64-bit tests: %v", test64err)
}
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4))
N := int64(1e3)
@@ -1099,8 +1087,7 @@ func TestStoreLoadSeqCst64(t *testing.T) {
func TestStoreLoadRelAcq32(t *testing.T) {
if runtime.NumCPU() == 1 {
- t.Logf("Skipping test on %v processor machine", runtime.NumCPU())
- return
+ t.Skipf("Skipping test on %v processor machine", runtime.NumCPU())
}
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4))
N := int32(1e3)
@@ -1145,12 +1132,10 @@ func TestStoreLoadRelAcq32(t *testing.T) {
func TestStoreLoadRelAcq64(t *testing.T) {
if runtime.NumCPU() == 1 {
- t.Logf("Skipping test on %v processor machine", runtime.NumCPU())
- return
+ t.Skipf("Skipping test on %v processor machine", runtime.NumCPU())
}
if test64err != nil {
- t.Logf("Skipping 64-bit tests: %v", test64err)
- return
+ t.Skipf("Skipping 64-bit tests: %v", test64err)
}
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4))
N := int64(1e3)
diff --git a/libgo/go/sync/atomic/doc.go b/libgo/go/sync/atomic/doc.go
index 33e1bcf..27a12c9 100644
--- a/libgo/go/sync/atomic/doc.go
+++ b/libgo/go/sync/atomic/doc.go
@@ -38,9 +38,12 @@ import (
"unsafe"
)
-// BUG(rsc): On ARM, the 64-bit functions use instructions unavailable before ARM 11.
+// BUG(rsc): On x86-32, the 64-bit functions use instructions unavailable before the Pentium MMX.
//
-// On x86-32, the 64-bit functions use instructions unavailable before the Pentium MMX.
+// On both ARM and x86-32, it is the caller's responsibility to arrange for 64-bit
+// alignment of 64-bit words accessed atomically. The first word in a global
+// variable or in an allocated struct or slice can be relied upon to be
+// 64-bit aligned.
// CompareAndSwapInt32 executes the compare-and-swap operation for an int32 value.
func CompareAndSwapInt32(addr *int32, old, new int32) (swapped bool)