]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/runtime/runtime1.go
[dev.cc] all: merge dev.power64 (7667e41f3ced) into dev.cc
[gostls13.git] / src / runtime / runtime1.go
index 3530619016da7e07562d4121869f516172ea755a..15dea01a3c6795342a6bc25c505def68e8ed77ac 100644 (file)
@@ -146,6 +146,7 @@ func check() {
                j, j1 float64
                k, k1 unsafe.Pointer
                l     *uint16
+               m     [4]byte
        )
        type x1t struct {
                x uint8
@@ -224,6 +225,14 @@ func check() {
                gothrow("cas4")
        }
 
+       z = 0xffffffff
+       if !cas(&z, 0xffffffff, 0xfffffffe) {
+               gothrow("cas5")
+       }
+       if z != 0xfffffffe {
+               gothrow("cas6")
+       }
+
        k = unsafe.Pointer(uintptr(0xfedcb123))
        if ptrSize == 8 {
                k = unsafe.Pointer(uintptr(unsafe.Pointer(k)) << 10)
@@ -239,6 +248,12 @@ func check() {
                gothrow("casp3")
        }
 
+       m = [4]byte{1, 1, 1, 1}
+       atomicor8(&m[1], 0xf0)
+       if m[0] != 1 || m[1] != 0xf1 || m[2] != 1 || m[3] != 1 {
+               gothrow("atomicor8")
+       }
+
        *(*uint64)(unsafe.Pointer(&j)) = ^uint64(0)
        if j == j {
                gothrow("float64nan")