// Keep the channels visible from Go.
var chans [4]chan bool
-//export GoStart
// Double return value is just for testing.
+//
+//export GoStart
func GoStart(i, xdim, ydim, xstart, xend, ystart, yend C.int, a *C.int, n *C.int) (int, int) {
c := make(chan bool, int(C.MYCONST))
go func() {
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build darwin
// +build darwin
package issue24161arg
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build darwin
// +build darwin
package issue24161arg
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build darwin
// +build darwin
package issue24161e0
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build darwin
// +build darwin
package issue24161e1
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build darwin
// +build darwin
package issue24161e2
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build darwin
// +build darwin
package issue24161res
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build gccgo
// +build gccgo
package issue9400
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build gc
// +build gc
package issue9400
// RunGoroutines starts some goroutines that don't do anything.
// The idea is to get some threads going, so that a signal will be delivered
// to a thread started by Go.
+//
//export RunGoroutines
func RunGoroutines() {
for i := 0; i < 4; i++ {
}
// Block blocks the current thread while running Go code.
+//
//export Block
func Block() {
select {}
var P *byte
// TestSEGV makes sure that an invalid address turns into a run-time Go panic.
+//
//export TestSEGV
func TestSEGV() {
defer func() {
}
// Noop ensures that the Go runtime is initialized.
+//
//export Noop
func Noop() {
}
// Raise SIGPIPE.
+//
//export GoRaiseSIGPIPE
func GoRaiseSIGPIPE() {
C.CRaiseSIGPIPE()
var sigioChan chan os.Signal
// CatchSIGIO starts catching SIGIO signals.
+//
//export CatchSIGIO
func CatchSIGIO() {
sigioChan = make(chan os.Signal, 1)
}
// ResetSIGIO stops catching SIGIO signals.
+//
//export ResetSIGIO
func ResetSIGIO() {
signal.Reset(syscall.SIGIO)
}
// SawSIGIO reports whether we saw a SIGIO.
+//
//export SawSIGIO
func SawSIGIO() C.int {
select {
}
// ProvokeSIGPIPE provokes a kernel-initiated SIGPIPE.
+//
//export ProvokeSIGPIPE
func ProvokeSIGPIPE() {
r, w, err := os.Pipe()
var sigioCount int32
// Catch SIGIO.
+//
//export GoCatchSIGIO
func GoCatchSIGIO() {
c := make(chan os.Signal, 1)
}
// Raise SIGIO.
+//
//export GoRaiseSIGIO
func GoRaiseSIGIO(p *C.pthread_t) {
C.CRaiseSIGIO(p)
}
// Return the number of SIGIO signals seen.
+//
//export SIGIOCount
func SIGIOCount() C.int {
return C.int(atomic.LoadInt32(&sigioCount))
-// Copyright 2022 The Go Authors. All rights reserved.\r
-// Use of this source code is governed by a BSD-style\r
-// license that can be found in the LICENSE file.\r
-package main\r
-\r
-// #include <complex.h>\r
-import "C"\r
-\r
-//export exportComplex64\r
-func exportComplex64(v complex64) complex64 {\r
- return v\r
-}\r
-\r
-//export exportComplex128\r
-func exportComplex128(v complex128) complex128 {\r
- return v\r
-}\r
-\r
-//export exportComplexfloat\r
-func exportComplexfloat(v C.complexfloat) C.complexfloat {\r
- return v\r
-}\r
-\r
-//export exportComplexdouble\r
-func exportComplexdouble(v C.complexdouble) C.complexdouble {\r
- return v\r
-}\r
-\r
-func main() {}\r
+// Copyright 2022 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.
+
+package main
+
+// #include <complex.h>
+import "C"
+
+//export exportComplex64
+func exportComplex64(v complex64) complex64 {
+ return v
+}
+
+//export exportComplex128
+func exportComplex128(v complex128) complex128 {
+ return v
+}
+
+//export exportComplexfloat
+func exportComplexfloat(v C.complexfloat) C.complexfloat {
+ return v
+}
+
+//export exportComplexdouble
+func exportComplexdouble(v C.complexdouble) C.complexdouble {
+ return v
+}
+
+func main() {}
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build darwin || dragonfly || freebsd || (linux && !arm64 && !riscv64) || netbsd || openbsd
// +build darwin dragonfly freebsd linux,!arm64,!riscv64 netbsd openbsd
package main
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build (linux && arm64) || (linux && riscv64)
// +build linux,arm64 linux,riscv64
package main
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
package main
// RunGoroutines starts some goroutines that don't do anything.
// The idea is to get some threads going, so that a signal will be delivered
// to a thread started by Go.
+//
//export RunGoroutines
func RunGoroutines() {
for i := 0; i < 4; i++ {
var P *byte
// TestSEGV makes sure that an invalid address turns into a run-time Go panic.
+//
//export TestSEGV
func TestSEGV() {
defer func() {
var sigioChan chan os.Signal
// CatchSIGIO starts catching SIGIO signals.
+//
//export CatchSIGIO
func CatchSIGIO() {
sigioChan = make(chan os.Signal, 1)
}
// ResetSIGIO stops catching SIGIO signals.
+//
//export ResetSIGIO
func ResetSIGIO() {
signal.Reset(syscall.SIGIO)
}
// SawSIGIO returns whether we saw a SIGIO within a brief pause.
+//
//export SawSIGIO
func SawSIGIO() C.int {
select {
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
+//go:build ignore
// +build ignore
package main
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
+//go:build ignore
// +build ignore
package main
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
+//go:build ignore
// +build ignore
package main
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
+//go:build ignore
// +build ignore
package main
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
+//go:build ignore
// +build ignore
package main
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
+//go:build ignore
// +build ignore
package main
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
+//go:build ignore
// +build ignore
package main
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
+//go:build ignore
// +build ignore
package main
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
+//go:build ignore
// +build ignore
package main
// license that can be found in the LICENSE file.
// The bug happened like this:
-// 1) The main binary adds an itab for *json.UnsupportedValueError / error
-// (concrete type / interface type). This itab goes in hash bucket 0x111.
-// 2) The plugin adds that same itab again. That makes a cycle in the itab
-// chain rooted at hash bucket 0x111.
-// 3) The main binary then asks for the itab for *dynamodbstreamsevt.Event /
-// json.Unmarshaler. This itab happens to also live in bucket 0x111.
-// The lookup code goes into an infinite loop searching for this itab.
+// 1. The main binary adds an itab for *json.UnsupportedValueError / error
+// (concrete type / interface type). This itab goes in hash bucket 0x111.
+// 2. The plugin adds that same itab again. That makes a cycle in the itab
+// chain rooted at hash bucket 0x111.
+// 3. The main binary then asks for the itab for *dynamodbstreamsevt.Event /
+// json.Unmarshaler. This itab happens to also live in bucket 0x111.
+// The lookup code goes into an infinite loop searching for this itab.
+//
// The code is carefully crafted so that the two itabs are both from the
// same bucket, and so that the second itab doesn't exist in
// the itab hashmap yet (so the entire linked list must be searched).
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
package main
// Keep the channels visible from Go.
var chans [4]chan bool
-//export GoStart
// Double return value is just for testing.
+//
+//export GoStart
func GoStart(i, xdim, ydim, xstart, xend, ystart, yend C.int, a *C.int, n *C.int) (int, int) {
c := make(chan bool, int(C.MYCONST))
go func() {
func (T) m() { println("m") }
-type I interface { m() }
+type I interface{ m() }
func F() {
i.m()
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
package main
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
package main
// allocateStack extends the stack so that stack copying doesn't
// confuse the msan data structures.
+//
//go:noinline
func allocateStack(i int) int {
if i == 0 {
// F1 marks a chunk of stack as uninitialized.
// C.f returns an uninitialized struct on the stack, so msan will mark
// the stack as uninitialized.
+//
//go:noinline
func F1() uintptr {
s := C.f()
// F2 allocates a struct on the stack and converts it to an empty interface,
// which will call msanread and see that the data appears uninitialized.
+//
//go:noinline
func F2() interface{} {
return C.S{}
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build gccgo
// +build gccgo
package depBase
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build gc
// +build gc
package depBase
// license that can be found in the LICENSE file.
// Package issue25065 has a type with a method that is
-// 1) referenced in a method expression
-// 2) not called
-// 3) not converted to an interface
-// 4) is a value method but the reference is to the pointer method
+// 1. referenced in a method expression
+// 2. not called
+// 3. not converted to an interface
+// 4. is a value method but the reference is to the pointer method
+//
// These cases avoid the call to makefuncsym from typecheckfunc, but we
// still need to call makefuncsym somehow or the symbol will not be defined.
package issue25065
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build aix || dragonfly || freebsd || linux || netbsd || solaris
// +build aix dragonfly freebsd linux netbsd solaris
package cgosotest
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
package main
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build ignore
// +build ignore
package main