Fix "PR c++/92804 ICE trying to use concept as a nested-name-specifier"
[official-gcc.git] / libgo / go / syscall / syscall_ptrace_test.go
blob6b7f54dcfd5c8d3881aad5b57d50187d916dd622
1 // Copyright 2019 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 // +build darwin dragonfly freebsd linux netbsd openbsd
7 package syscall_test
9 import (
10 "internal/testenv"
11 "os"
12 "os/exec"
13 "syscall"
14 "testing"
17 func TestExecPtrace(t *testing.T) {
18 testenv.MustHaveExec(t)
20 bin, err := exec.LookPath("sh")
21 if err != nil {
22 t.Skipf("skipped because sh is not available")
25 attr := &os.ProcAttr{
26 Sys: &syscall.SysProcAttr{
27 Ptrace: true,
30 proc, err := os.StartProcess(bin, []string{bin}, attr)
31 if err == nil {
32 proc.Kill()
34 if err != nil && !os.IsPermission(err) {
35 t.Fatalf("StartProcess with ptrace enabled failed: %v", err)