github.com/riscv/riscv-go@v0.0.0-20200123204226-124ebd6fcc8e/misc/cgo/testshared/src/depBase/dep.go (about)

     1  package depBase
     2  
     3  import (
     4  	"os"
     5  	"reflect"
     6  )
     7  
     8  var SlicePtr interface{} = &[]int{}
     9  
    10  var V int = 1
    11  
    12  var HasMask []string = []string{"hi"}
    13  
    14  type HasProg struct {
    15  	array [1024]*byte
    16  }
    17  
    18  type Dep struct {
    19  	X int
    20  }
    21  
    22  func (d *Dep) Method() int {
    23  	// This code below causes various go.itab.* symbols to be generated in
    24  	// the shared library. Similar code in ../exe/exe.go results in
    25  	// exercising https://github.com/golang/go/issues/17594
    26  	reflect.TypeOf(os.Stdout).Elem()
    27  	return 10
    28  }
    29  
    30  func F() int {
    31  	defer func() {}()
    32  	return V
    33  }