Fix "PR c++/92804 ICE trying to use concept as a nested-name-specifier"
[official-gcc.git] / libgo / go / syscall / syscall_plan9_test.go
blobc0b3af55d1d7865e5fe8b58a9f9dbcdfadfdec31
1 // Copyright 2018 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 package syscall_test
7 import (
8 "syscall"
9 "testing"
12 // testalias checks for aliasing of error strings returned by sys1 and sys2,
13 // which both call the function named fn in package syscall
14 func testalias(t *testing.T, fn string, sys1, sys2 func() error) {
15 err := sys1().Error()
16 errcopy := string([]byte(err))
17 sys2()
18 if err != errcopy {
19 t.Errorf("syscall.%s error string changed from %q to %q\n", fn, errcopy, err)
23 // issue 13770: errors cannot be nested in Plan 9
25 func TestPlan9Syserr(t *testing.T) {
26 testalias(t,
27 "Syscall",
28 func() error {
29 return syscall.Mkdir("/", 0)
31 func() error {
32 return syscall.Mkdir("#", 0)
34 testalias(t,
35 "Syscall6",
36 func() error {
37 return syscall.Mount(0, 0, "", 0, "")
39 func() error {
40 return syscall.Mount(-1, 0, "", 0, "")
42 // originally failed only on plan9_arm
43 testalias(t,
44 "seek",
45 func() error {
46 _, err := syscall.Seek(0, 0, -1)
47 return err
49 func() error {
50 _, err := syscall.Seek(-1, 0, 0)
51 return err