// It's not quite read only, the state field must be modifiable.
ggloblsym(lsym, int32(ot), obj.NOPTR)
}
-
-func (n *Node) checkInitFuncSignature() {
- if n.Type.NumRecvs()+n.Type.NumParams()+n.Type.NumResults() > 0 {
- Fatalf("init function cannot have receiver, params, or results: %v (%v)", n, n.Type)
- }
-}
// builtinpkg is a fake package that declares the universe block.
var builtinpkg *types.Pkg
-var itable *types.Type // distinguished *byte
-
var basicTypes = [...]struct {
name string
etype types.EType
dowidth(types.Types[TSTRING])
dowidth(types.Idealstring)
-
- itable = types.NewPtr(types.Types[TUINT8])
}
func makeErrorInterface() *types.Type {
import "testing"
-type lca interface {
- find(a, b *Block) *Block
-}
-
-func lcaEqual(f *Func, lca1, lca2 lca) bool {
- for _, b := range f.Blocks {
- for _, c := range f.Blocks {
- if lca1.find(b, c) != lca2.find(b, c) {
- return false
- }
- }
- }
- return true
-}
-
func testLCAgen(t *testing.T, bg blockGen, size int) {
c := testConfig(t)
fun := c.Fun("entry", bg(size)...)
return v.AuxInt == 0
}
-// i2f is used in rules for converting from an AuxInt to a float.
-func i2f(i int64) float64 {
- return math.Float64frombits(uint64(i))
-}
-
// auxFrom64F encodes a float64 value so it can be stored in an AuxInt.
func auxFrom64F(f float64) int64 {
return int64(math.Float64bits(f))