diff options
author | Ian Lance Taylor <iant@golang.org> | 2023-06-21 11:04:04 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2023-06-21 11:04:04 -0700 |
commit | 97e31a0a2a2d2273687fcdb4e5416aab1a2186e1 (patch) | |
tree | d5c1cae4de436a0fe54a5f0a2a197d309f3d654c /libgo/go | |
parent | 6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced (diff) | |
parent | 577223aebc7acdd31e62b33c1682fe54a622ae27 (diff) | |
download | gcc-97e31a0a2a2d2273687fcdb4e5416aab1a2186e1.zip gcc-97e31a0a2a2d2273687fcdb4e5416aab1a2186e1.tar.gz gcc-97e31a0a2a2d2273687fcdb4e5416aab1a2186e1.tar.bz2 |
Merge from trunk revision 577223aebc7acdd31e62b33c1682fe54a622ae27.
Diffstat (limited to 'libgo/go')
-rw-r--r-- | libgo/go/internal/fuzz/encoding_test.go | 9 | ||||
-rw-r--r-- | libgo/go/mime/type_test.go | 5 | ||||
-rw-r--r-- | libgo/go/mime/type_unix_test.go | 1 | ||||
-rw-r--r-- | libgo/go/runtime/mem_gccgo.go | 6 | ||||
-rw-r--r-- | libgo/go/syscall/libcall_linux.go | 8 |
5 files changed, 25 insertions, 4 deletions
diff --git a/libgo/go/internal/fuzz/encoding_test.go b/libgo/go/internal/fuzz/encoding_test.go index 8e3800e..53fc5b8 100644 --- a/libgo/go/internal/fuzz/encoding_test.go +++ b/libgo/go/internal/fuzz/encoding_test.go @@ -6,6 +6,7 @@ package fuzz import ( "math" + "runtime" "strconv" "testing" "unicode" @@ -330,6 +331,14 @@ func FuzzFloat64RoundTrip(f *testing.F) { f.Add(math.Float64bits(math.Inf(-1))) f.Fuzz(func(t *testing.T, u1 uint64) { + // The signaling NaN test fails on 32-bit x86 with gccgo, + // which uses the 387 floating-point stack by default. + // Converting a signaling NaN in and out of the stack + // changes the NaN to a quiet NaN. + if runtime.GOARCH == "386" && u1 == 0x7FF0000000000001 { + t.Skip("skipping signalling NaN test on 386 with gccgo") + } + x1 := math.Float64frombits(u1) b := marshalCorpusFile(x1) diff --git a/libgo/go/mime/type_test.go b/libgo/go/mime/type_test.go index 5e4d25c..5769c6a 100644 --- a/libgo/go/mime/type_test.go +++ b/libgo/go/mime/type_test.go @@ -14,7 +14,10 @@ import ( func setMimeInit(fn func()) (cleanup func()) { once = sync.Once{} testInitMime = fn - return func() { testInitMime = nil } + return func() { + testInitMime = nil + once = sync.Once{} + } } func clearMimeTypes() { diff --git a/libgo/go/mime/type_unix_test.go b/libgo/go/mime/type_unix_test.go index 4d109aa..43db44b 100644 --- a/libgo/go/mime/type_unix_test.go +++ b/libgo/go/mime/type_unix_test.go @@ -11,6 +11,7 @@ import ( ) func initMimeUnixTest(t *testing.T) { + once.Do(initMime) err := loadMimeGlobsFile("testdata/test.types.globs2") if err != nil { t.Fatal(err) diff --git a/libgo/go/runtime/mem_gccgo.go b/libgo/go/runtime/mem_gccgo.go index 1e84f4f..e7b51ff 100644 --- a/libgo/go/runtime/mem_gccgo.go +++ b/libgo/go/runtime/mem_gccgo.go @@ -14,8 +14,8 @@ import ( //go:linkname sysAlloc //go:linkname sysFree -//extern mmap -func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off _libgo_off_t_type) unsafe.Pointer +//extern __go_mmap +func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer //extern munmap func munmap(addr unsafe.Pointer, length uintptr) int32 @@ -38,7 +38,7 @@ func init() { } func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) { - p := sysMmap(addr, n, prot, flags, fd, _libgo_off_t_type(off)) + p := sysMmap(addr, n, prot, flags, fd, off) if uintptr(p) == _MAP_FAILED { return nil, errno() } diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go index 19ae439..03ca726 100644 --- a/libgo/go/syscall/libcall_linux.go +++ b/libgo/go/syscall/libcall_linux.go @@ -189,6 +189,14 @@ func Gettid() (tid int) { //sys PivotRoot(newroot string, putold string) (err error) //pivot_root(newroot *byte, putold *byte) _C_int +// Used by golang.org/x/sys/unix. +//sys prlimit(pid int, resource int, newlimit *Rlimit, oldlimit *Rlimit) (err error) +//prlimit(pid Pid_t, resource _C_int, newlimit *Rlimit, oldlimit *Rlimit) _C_int + +func Prlimit(pid int, resource int, newlimit *Rlimit, oldlimit *Rlimit) error { + return prlimit(pid, resource, newlimit, oldlimit) +} + //sys Removexattr(path string, attr string) (err error) //removexattr(path *byte, name *byte) _C_int |