// Code generated by cmd/cgo; DO NOT EDIT.

//line /home/xzl/work/golang-1.22/golang-1.22/src/runtime/testdata/testprogcgo/segv.go:1:1
// Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build unix

package main

// #include <unistd.h>
// static void nop() {}
import _ "unsafe"

import "syscall"

func init() {
	register("SegvInCgo", SegvInCgo)
}

func SegvInCgo() {
	c := make(chan bool)
	go func() {
		close(c)
		for {
			( /*line :24:4*/_Cfunc_nop /*line :24:8*/)()
		}
	}()

	<-c

	syscall.Kill(syscall.Getpid(), syscall.SIGSEGV)

	// Wait for the OS to deliver the signal.
	( /*line :33:2*/_Cfunc_pause /*line :33:8*/)()
}
