type targetPanic … func (p targetPanic) String() string { … } type exitPanic … // constValue returns the value of the constant with the // dynamic type tag appropriate for c.Type(). func constValue(c *ssa.Const) value { … } // fitsInt returns true if x fits in type int according to sizes. func fitsInt(x int64, sizes types.Sizes) bool { … } // asInt64 converts x, which must be an integer, to an int64. // // Callers that need a value directly usable as an int should combine this with fitsInt(). func asInt64(x value) int64 { … } // asUint64 converts x, which must be an unsigned integer, to a uint64 // suitable for use as a bitwise shift count. func asUint64(x value) uint64 { … } // asUnsigned returns the value of x, which must be an integer type, as its equivalent unsigned type, // and returns true if x is non-negative. func asUnsigned(x value) (value, bool) { … } // zero returns a new "zero" value of the specified type. func zero(t types.Type) value { … } // slice returns x[lo:hi:max]. Any of lo, hi and max may be nil. func slice(x, lo, hi, max value) value { … } // lookup returns x[idx] where x is a map. func lookup(instr *ssa.Lookup, x, idx value) value { … } // binop implements all arithmetic and logical binary operators for // numeric datatypes and strings. Both operands must have identical // dynamic type. func binop(op token.Token, t types.Type, x, y value) value { … } // eqnil returns the comparison x == y using the equivalence relation // appropriate for type t. // If t is a reference type, at most one of x or y may be a nil value // of that type. func eqnil(t types.Type, x, y value) bool { … } func unop(instr *ssa.UnOp, x value) value { … } // typeAssert checks whether dynamic type of itf is instr.AssertedType. // It returns the extracted value on success, and panics on failure, // unless instr.CommaOk, in which case it always returns a "value,ok" tuple. func typeAssert(i *interpreter, instr *ssa.TypeAssert, itf iface) value { … } var CapturedOutput … var capturedOutputMu … // write writes bytes b to the target program's standard output. // The print/println built-ins and the write() system call funnel // through here so they can be captured by the test driver. func print(b []byte) (int, error) { … } // callBuiltin interprets a call to builtin fn with arguments args, // returning its result. func callBuiltin(caller *frame, callpos token.Pos, fn *ssa.Builtin, args []value) value { … } func rangeIter(x value, t types.Type) iter { … } // widen widens a basic typed value x to the widest type of its // category, one of: // // bool, int64, uint64, float64, complex128, string. // // This is inefficient but reduces the size of the cross-product of // cases we have to consider. func widen(x value) value { … } // conv converts the value x of type t_src to type t_dst and returns // the result. // Possible cases are described with the ssa.Convert operator. func conv(t_dst, t_src types.Type, x value) value { … } // sliceToArrayPointer converts the value x of type slice to type t_dst // a pointer to array and returns the result. func sliceToArrayPointer(t_dst, t_src types.Type, x value) value { … } // checkInterface checks that the method set of x implements the // interface itype. // On success it returns "", on failure, an error message. func checkInterface(i *interpreter, itype *types.Interface, x iface) string { … } func foldLeft(op func(value, value) value, args []value) value { … } func min(x, y value) value { … } func max(x, y value) value { … } type floaty … func fmin[F floaty](x, y F) F { … } func fmax[F floaty](x, y F) F { … } func forbits[F floaty](x, y F) F { … } func fandbits[F floaty](x, y F) F { … }