]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/debug: skip fault address test on unsupported platforms
authorKeith Randall <khr@golang.org>
Fri, 18 Sep 2020 20:01:54 +0000 (13:01 -0700)
committerKeith Randall <khr@golang.org>
Fri, 18 Sep 2020 22:09:45 +0000 (22:09 +0000)
Change-Id: I6a6fe616365fa542218fbc9ff61805ff70a1ef63
Reviewed-on: https://go-review.googlesource.com/c/go/+/255999
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Trust: Keith Randall <khr@golang.org>

src/runtime/debug/panic_test.go

index 2aad418bae1a929625d0875742a87a498969e80b..4b7830e10051240a7e312082819fcd520df07aed 100644 (file)
@@ -9,6 +9,7 @@
 package debug_test
 
 import (
+       "runtime"
        "runtime/debug"
        "syscall"
        "testing"
@@ -16,6 +17,12 @@ import (
 )
 
 func TestPanicOnFault(t *testing.T) {
+       if runtime.GOARCH == "s390x" {
+               t.Skip("s390x fault addresses are missing the low order bits")
+       }
+       if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
+               t.Skip("darwin/arm64 doesn't provide fault addresses")
+       }
        m, err := syscall.Mmap(-1, 0, 0x1000, syscall.PROT_READ /* Note: no PROT_WRITE */, syscall.MAP_SHARED|syscall.MAP_ANON)
        if err != nil {
                t.Fatalf("can't map anonymous memory: %s", err)