package main i32test(a, b, -2) Val [2]int32 return n, nil b = a / 8 return nil, err goarch = runtime.GOARCH usage() Version uint8 goFiles := args[i:] Seekoff uint64 NodeDot // The cursor, dot. // simplifyComplex pulls out any other types that are represented by the complex number. "os" NodeWith // A with action. } type sendfileOp struct { b = a / 256 b = a / 7 x.T = add("abc", "def") type endNode bool Nvcsw int64 Mode uint16 } func BenchmarkJSONDecode(b *testing.B) { b = a / -64 } Offset int64 gobinit() NodeType Omcasts uint32 `` + os.Setenv("LC_ALL", "C") // Implementation note: Print is written for AST nodes but could be case NodeWith: } b = a / 64 b = a / 16 func newTemplate(line int, name string, pipe *PipeNode) *TemplateNode { defer func() { func newField(ident string) *FieldNode { } SizeofSockaddrAny = 0x6c u64test(a, b, 8) u8test(a, b, 4) type elseNode struct { } Fsid Fsid // This benchmark tests JSON encoding and decoding performance. Flags uint32 b = a / 8 error_(token.NoPos, "inconsistent package names: %s, %s", p.PackageName, f.Package) // Cgo; see gmp.go for an overview. p.line++ if a[i**dim+j] == 0 { t.Errorf("red = %v, want 3", x) last: '\n', // force printing of line number on first line // We already put _cgo_ at the beginning, so the main b = a / 60 } // BranchNode is the common representation of if, range, and with. NodeType K uint32 type TextNode struct { _C_long_long int64 "os" name.Set("Mike") b = a / 4 a := int8(rand.Uint32()) Family uint8 var gen = flag.Int("gen", 10, "generations") `Some text.` + type IPv6Mreq struct { Uint64 uint64 // The unsigned integer value. u16test(a, b, 3) NodeField // A field or method name. b = a / -128 func (t *TemplateNode) String() string { } func (f *FieldNode) String() string { Len uint8 Pad_cgo_0 [4]byte Name string `json:"name"` } name := NewString("my-name") if i == 0 { if d != b { `John Doe` + if d != b { a = u64rand() x.Y = 0x12345678 b = a / 7 ifaceeq+0x15c /Users/rsc/goX/src/runtime/iface.c:501 Index uint16 b = a / 1 n.Float64 = float64(n.Int64) } } b = a / 7 x.X = 2 << 28 "io" for i := 0; i < Count; i++ { i64test(a, b, 128) Float64 float64 // The floating-point value. Addrs int32 var c chan int i8test(a, b, 127) // A FuncType collects information about a function type in both the C and Go worlds. type localError struct { } else { // can grow without overwriting the slice that args is in. // Run the game of life in C using Go for parallelization. u64test(a, b, 2) } b.SetBytes(int64(len(jsonbytes))) // default if s := reqs.String(); s != "2.75" { Path [104]int8 println("u32", a, b, c, d) b = a / 1 // by doc comments containing the line //export ExpName // Control actions have their own nodes; ActionNode represents simple // printf is a convenience wrapper that takes care of print errors. } type StringNode struct { fmt.Print(" ") // if handled == false, sendFile performed no work. Text string // The original textual representation from the input. Lspare int32 Index uint16 } output: w, b = a / -5 } b = a / 2 m, err = p.output.Write(data[n : i+1]) } n.Uint64 = u } } SizeofInet6Pktinfo = 0x14 Inits uint32 } t.Errorf("reqs.f = %v, want 2.75", reqs.f) reqs.Add(1) } } Recvpipe uint32 i64test(a, b, 16384) Pad_cgo_0 [3]byte b = a / 2 func i32rand() int32 { if dir := os.Getenv("CGOPKGPATH"); dir != "" { case reflect.Map: n, r = lr.N, lr.R Scope_id uint32 } f, err := os.Open(input) } b := new(bytes.Buffer) p.printf("%q", v) p.printf("%s", p.fset.Position(v)) } return nil } // appropriate executable and then use its import information i8test(a, b, -60) func TestString(t *testing.T) { i32test(a, b, 16) b = a / 7 Const string // constant definition b = a / -6 IsInt bool // Number has an integral value. } Sec int32 i32test(a, b, -20) jsonbytes = b p.Translate(f) } True bool // The value of the boolean constant. p.Name = f.Name u64test(a, b, 128) b = a / 2 n.Int64 = int64(n.Float64) mainstart() i32test(a, b, 1) Family uint8 var cdefs = flag.Bool("cdefs", false, "for bootstrap: write C definitions for C file to standard output") } } b = a / 3 // we use to coordinate between gcc and ourselves. Addrs int32 } } } } NodeType Version uint8 // make sure whole word is being compared, t.Errorf("reqs.String() = %q, want \"\"Mike\"\"", s) p := printer{ // newPackage returns a new Package that will invoke if err != nil { type VariableNode struct { b = a / -16384 // NumberNode holds a number: signed or unsigned integer, float, or complex. } if err != nil { if x := colors.m["red"].(*Int).i; x != 3 { } b = a / 3 type NodeType int i16test(a, b, -3) Flags int32 b = a / 5 // for i, input := range goFiles { type _Gid_t uint32 j := v.Field(1) // Use of this source code is governed by a BSD-style b = a / 128 Expire int32 } u32test(a, b, 6) var n int64 = 0 // by default, copy until EOF return a func add(s, t string) string { n += m } if name.s != "Mike" { "arm": 4, func (a *ActionNode) String() string { b = a / 128 i32test(a, b, -128) } b = a / 1 b = a / 5 Atimespec Timespec } buf, err := json.Marshal(&jsondata) NodeCommand // An element of a pipeline. colors.Add("red", 1) u16test(a, b, 5) // Use of this source code is governed by a BSD-style } "reflect" return true i64test(a, b, -128) p.printf("%s (len = %d) {\n", x.Type(), x.Len()) return Hdrlen uint16 } b = a / 6 func u32test(a, b, c uint32) { i16test(a, b, -1) } Msgrcv int64 b = a / -2 "strings" // Need a unique prefix for the global C symbols that // A non-nil FieldFilter f may be provided to control the output: ) func newText(text string) *TextNode { i8test(a, b, -10) b = a / 184 func newNumber(text string, typ itemType) (*NumberNode, error) { u64test(a, b, 256) } "fmt" // } jsonenc() Major uint16 } Unused1 uint8 b = a / 5 func (t *TextNode) String() string { } f := fs[i] Int64 int64 // The signed integer value. i64test(a, b, 6) } func u64test(a, b, c uint64) { if s := os.Getenv("GOARCH"); s != "" { Link: []Link{{Href: "http://example.org/2003/12/13/atom03"}}, } MinT int64 `json:"min_t"` // elseNode represents an {{else}} action. Does not appear in the final tree. u32test(a, b, 16384) const ( SizeofBpfProgram = 0x10 u64test(a, b, 5) i8test(a, b, 10) Quoted string // The original text of the string, with quotes. } b = a / 256 u16test(a, b, 8) b = a / -32 p.writeDefs() } b = a / 16384 i32test(a, b, 4) n.IsInt = true return fmt.Sprintf("({{%s %s}} %s {{else}} %s)", name, b.Pipe, b.List, b.ElseList) p.printf("\n") fmt.Fprint(b, "]") Flags uint16 for { } if n.IsInt { println("i16", a, b, c, d) // Copyright 2009 The Go Authors. All rights reserved. Decl []*VariableNode // Variable declarations in lexical order. if d != b { fmt.Fprint(os.Stderr, "usage: cgo -- [compiler options] file.go ...\n") NodeString // A string constant. } G float32 PtrSize int64 } Jf uint8 r = strings.NewReader(jsonbz2_base64) // Type returns itself and provides an easy default implementation Metric uint32 Written: make(map[string]bool), Msglen uint16 Caplen uint32 l.Nodes = append(l.Nodes, n) BranchNode // should catch those as well. d := a / c u32test(a, b, 128) } b = a / 8 return nil Name string // The name of the template (unquoted). } b = a / 32 b = a / 16 MeanT int64 `json:"mean_t"` func (l *ListNode) append(n Node) { indent int // current indentation level Ssthresh uint32 i = v.Field(8) Name *Name W uint32 // license that can be found in the LICENSE file. if err == nil { var atomXml = `` + return p b = a / -4 Define string // #define expansion i64run() i32test(a, b, 8) t.Error("colors.String() didn't produce a map.") p.Decl = append(p.Decl, f.AST.Decls...) b = a / 256 return a } func (e *endNode) Type() NodeType { f.ReadGo(input) } // license that can be found in the LICENSE file. } } func main() { reqs.Set(-2) Ibytes uint32 return a return case itemComplex: default: } else { func (e *endNode) String() string { import ( type printer struct { "fmt" a = u8rand() } b = a / -60 } return b.String() b = a / -8 case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: NodeType Id: "urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6", Contigbytes int64 i32test(a, b, -7) } i8test(a, b, 7) return n, nil i16test(a, b, -8) } sys·ifaceeq+0x48 /Users/rsc/goX/src/runtime/iface.c:527 b = a / 4 // VariableNode holds a list of variable names. The dollar sign is // non-EOF error. } var a [MAXDIM * MAXDIM]int SizeofSockaddrUnix = 0x6a Max uint64 b = a / -1 return nil, err u8test(a, b, 10) b = a / 10 Updated: ParseTime("2003-12-13T18:30:02Z"), u16test(a, b, 10) if -a != a { "flag" } Touches int `json:"touches"` } // If fset != nil, position information is interpreted relative Type uint8 var fset = token.NewFileSet() func (i *IdentifierNode) String() string { type CommandNode struct { var a, b uint32 u16test(a, b, 128) return fmt.Sprintf("{{template %q}}", t.Name) } b = a / 64 if -a != a { if lr != nil { b = a / 16 "io" j = v.Field(7) Expr *ast.Expr GoFiles []string // list of Go files } Bavail uint64 u32test(a, b, 3) b = a / 3 colors.Add("blue", 4) return fmt.Sprintf("V=%s", v.Ident) i64test(a, b, 20) i64test(a, b, -32) } } } // constant values used in the host's C libraries and system calls. sys·ifaceeq(0x2aa7c0, 0x0, 0x0, 0x0, 0x2aa7c0, ...) t.Errorf("reqs.i = %v, want 4", reqs.i) } } u32test(a, b, 60) } throw+0x41 /Users/rsc/goX/src/runtime/runtime.c:54 type IfmaMsghdr2 struct { Gid uint32 func main() { b = a / -64 Typedef map[string]ast.Expr // translations of all necessary types from C func NewText(text string) Text { func (n *NumberNode) simplifyComplex() { NodeText NodeType = iota // Plain text. Unused2 uint32 a = i32rand() } i32test(a, b, 10) Rttvar uint32 b = a / 6 // Make 6g understand the annotations. i64test(a, b, -1) nodeElse // An else action. Not added to tree. Go string // name used in Go referring to package C } else { sizeofLong = 0x8 Typedef map[string]ast.Expr // accumulated Typedef from Files i16test(a, b, 7) Rtt uint32 } NodeType FuncType *FuncType case reflect.Interface: b = a / -1 } if err != nil { p.printf("\n") i8test(a, b, -20) } b = a / 10 b = a / 8 type RtMsghdr struct { i8test(a, b, -8) BranchNode } return int64(done), nil, true b = a / 10 "syscall" i16test(a, b, 3) Decl []ast.Decl b = a / 5 } type RawSockaddrUnix struct { os.Exit(2) // probably be in a different package. type JSONResponse struct { return &elseNode{NodeType: nodeElse, Line: line} b = a / -5 // concern is other cgo wrappers for the same functions. } Pad_cgo_0 [2]byte } u64test(a, b, 16384) } } "life" } } // A Name collects information about C.xxx. // gcc with the additional arguments specified in args. n.IsUint = true i64test(a, b, 1) } // to keep track of objects that have been printed } type FieldFilter func(name string, value reflect.Value) bool // license that can be found in the LICENSE file. return fmt.Sprintf("S=%#q", s.Text) Flags int32 if reqs.f != 0.0 { panic("fail") Reserved [8]uint32 fmt.Print("\n") } func u8test(a, b, c uint8) { // for embedding in a Node. Embedded in all non-trivial Nodes. return 0 // impossible // license that can be found in the LICENSE file. reqs.Add(1.5) type Msghdr struct { b = a / 32 CgoFlags map[string]string // #cgo flags (CFLAGS, LDFLAGS) // A TypeRepr contains the string representation of a type. } } // used to print arbitrary data structures; such a version should "compress/bzip2" Text []byte // The text; may span newlines. i16test(a, b, 8) } if c <- v { // ERROR "send statement.*value.*select" func assert(b bool) { } `` + assert(s.Interface() == t.Interface()) b = a / -5 u8test(a, b, 20) } u8test(a, b, 64) } Pipe *PipeNode // The pipeline to be evaluated. println("i8", a, b, c, d) Kind string // "const", "type", "var", "func", "not-type" // license that can be found in the LICENSE file. Addrlen uint8 Args []Node // Arguments in lexical order: Identifier, field, or constant. u64test(a, b, 4) b = a / -8 return a } func (o *sendfileOp) Name() string { b = a / 32 b = a / 128 Mntonname [1024]int8 u16test(a, b, 16384) a >>= uint(rand.Intn(64)) u16test(a, b, 64) Align int64 return &RangeNode{BranchNode{NodeType: NodeRange, Line: line, Pipe: pipe, List: list, ElseList: elseList}} return 0 // impossible b = a / 64 b = a / 3 } reqs := NewFloat("requests-float") for i, n := 0, x.Len(); i < n; i++ { for k, v := range f.Name { t.Errorf("name.s = %q, want \"Mike\"", name.s) // Fprint prints the (sub-)tree starting at AST node x to w. f, ok := r.(*os.File) b = a / 3 BranchNode p.print(key) b = a / 256 func (v *VariableNode) String() string { type Fstore_t struct { u8test(a, b, 32) if s := os.Getenv("GOOS"); s != "" { Flags uint32 func u32rand() uint32 { type BoolNode struct { func usage() { n.Float64 = f return type Linger struct { SizeofRtMsghdr = 0x5c p.printf(": ") } a = i64rand() case reflect.Slice: case string: } u64test(a, b, 64) u16test(a, b, 6) n.Uint64 = u if p.filter == nil || p.filter(name, value) { for _, key := range x.MapKeys() { m, err = p.output.Write(data[n:]) } Written map[string]bool f, err := strconv.ParseFloat(text, 64) return fmt.Sprintf("(text: %q)", t.Text) // though the order of red and blue could vary. } SizeofIPv6Mreq = 0x14 } i16test(a, b, 6) fmt.Fprint(b, "[") Context string // "type", "expr", "call", or "call2" Cmds []*CommandNode // The commands in lexical order. // position values can be printed nicely if we have a file set b, err := ioutil.ReadAll(r) Version uint8 func newAction(line int, pipe *PipeNode) *ActionNode { type T struct { ) Name *byte f, err := strconv.ParseFloat(text[:len(text)-1], 64) func BenchmarkJSONEncode(b *testing.B) { written int // number of bytes written to output return fmt.Sprintf("F=%s", f.Ident) b = a / -6 b = a / 20 u16test(a, b, 60) } } p.Cmds = append(p.Cmds, command) i32test(a, b, 3) IsFloat bool // Number has a floating-point value. Type uint8 Mtimespec Timespec b = a / -10 rune, _, tail, err := strconv.UnquoteChar(text[1:], text[0]) } // FieldNode holds a field (identifier starting with '.'). Type *Type // the type of xxx } // Use of this source code is governed by a BSD-style i64test(a, b, -10) b = a / 64 b = a / 20 Minor uint16 func newIf(line int, pipe *PipeNode, list, elseList *ListNode) *IfNode { SizeofLinger = 0x8 // endNode represents an {{end}} action. It is represented by a nil pointer. if *godefs && *cdefs { NodeType Xmittiming uint32 life.Run(*gen, *dim, *dim, a[:]) u64test(a, b, 7) for i := 0; i < Count; i++ { func u16test(a, b, c uint16) { i8test(a, b, 20) i16test(a, b, -20) "testing" if s, exp := f.String(), `17`; s != exp { func u16run() { "flag" for { type Timeval32 struct { Idrss int64 b = a / 5 Insns *BpfInsn i16test(a, b, -7) Flags uint32 // The value is parsed and stored under all the types that can represent the value. } Type uint32 "crypto/md5" name = "with" } } for i := 0; i < Count; i++ { type File struct { type IfMsghdr struct { if !n.IsInt && float64(int64(f)) == f { ) b = a / 20 Hdrlen uint8 a >>= uint(rand.Intn(32)) func main() { i32test(a, b, -256) } i32test(a, b, -10) func u8rand() uint8 { Size int64 } Type uint8 Index uint16 if p.Decl != nil { b = a / 60 } } else { type BpfInsn struct { return a := int64(rand.Uint32()) } s := colors.String() b = a / 64 Oublock int64 Minflt int64 b = a / 256 n.IsFloat = true "strconv" p.written += n n.IsUint = true // in case of -0. NodeType _, err = p.output.Write(indent) b = a / 4 defer c.decref() NodeType } Version uint8 // install error handler Pad_cgo_0 [2]byte Msglen uint16 b = a / 32 Control *byte return fmt.Sprintf("%v", p.Cmds) a := uint64(rand.Uint32()) if !b { // Interface comparisons using types hidden t.Errorf("reqs.f = %v, want 0.75", reqs.f) } p.print(value) Code uint16 NodeType return &BoolNode{NodeType: NodeBool, True: true} "strings" i64test(a, b, 5) } } else if n.IsUint { } C *TypeRepr b = a / -128 Name [1024]int8 b = a / 20 if len(text) > 0 && text[len(text)-1] == 'i' { SizeofRtMetrics = 0x38 o.src = f.Fd() } i32test(a, b, 6) if err != nil { Go ast.Expr done, err := iosrv.ExecIO(&o, 0) b = a / -60 func i64run() { Controllen uint32 i = v.Field(6) switch b.NodeType { } b = a / 128 type RawSockaddrInet6 struct { last byte // the last byte processed by Write var a, b uint64 // Use of this source code is governed by a BSD-style x.G = x.F func newPipeline(line int, decl []*VariableNode) *PipeNode { func u8run() { u8test(a, b, 3) return }, "strings" i32test(a, b, 128) b = a / 128 b = a / -4 Line int // The line number in the input. panic(localError{err}) } } type BpfHdr struct { if x == nil { // A File collects information about a single Go input file. func newDot() *DotNode { SizeofBpfStat = 0x8 if b.ElseList != nil { return fmt.Sprintf("N=%s", n.Text) "fmt" b = a / 8 // print strings in quotes const ( type Timeval struct { comparing uncomparable type float32 type Node interface { i16test(a, b, 64) i32test(a, b, -6) if err == nil { `2003-12-13T18:30:02Z` + p.print(x.Elem()) u8test(a, b, 8) ) x.F = 1.0 a = u16rand() return &TextNode{NodeType: NodeText, Text: []byte(text)} var i int func ParseTime(str string) Time { // that are options to pass to gcc. p.printf("*") // all the output files there. } n.IsComplex = true return // specialized knowledge gcc has about where to look for imported p.printf("%s (len = %d) {\n", x.Type(), x.Len()) b = a / 3 } Data IfData } } a := uint8(rand.Uint32()) func TestFunc(t *testing.T) { b = a / -16 o.n = uint32(n) b = a / 8 if d != b { // license that can be found in the LICENSE file. println("u8", a, b, c, d) b.SetBytes(int64(len(jsonbytes))) func main() { // The names may be chained ('.x.y'). j = v.Field(9) } Flags int32 p.Name[k] = v Addr [16]byte /* in6_addr */ // IdentifierNode holds an identifier. type Type struct { type Stat_t struct { func jsondec() { i8test(a, b, -4) type RawSockaddrInet4 struct { b = a / 6 Type uint8 sizeofShort = 0x2 } // setup printer Seq int32 type DotNode bool n.Float64 = real(n.Complex128) b = a / 4 } } b = a / 16 } ExpFunc []*ExpFunc // exported functions for this file } b = a / 5 Namelen uint32 } return 0, err, false b = a / 20 b = a / 1 } ) Multiaddr [4]byte /* in_addr */ sys·Goexit /Users/rsc/goX/src/runtime/proc.c:124 i8test(a, b, 32) var x T Len uint64 // inside reflected-on structs. *objDir += string(filepath.Separator) } GccFiles []string // list of gcc output files } } return nil, fmt.Errorf("illegal number syntax: %q", text) n = p.written Whence int16 os.Setenv("LANG", "en_US.UTF-8") Length uint64 i8test(a, b, -7) i8test(a, b, 2) a >>= uint(rand.Intn(32)) b = a / 128 type RawSockaddr struct { pkg = filepath.Join(dir, pkg) MaxT int64 `json:"max_t"` Fstypename [16]int8 func newCommand() *CommandNode { p.Record(f) ExpFunc []*ExpFunc // accumulated ExpFunc from Files x.S = add("abc", "def") } Package string // Package name if cref.Name.Kind != "type" { c.wio.Lock() return 0, nil, true u16test(a, b, 20) type Rusage struct { } else if *cdefs { case reflect.Ptr: SizeofIfmaMsghdr = 0x10 return &ActionNode{NodeType: NodeAction, Line: line, Pipe: pipe} } return a type FdSet struct { func newPackage(args []string) *Package { if t.Pipe == nil { Complex128 complex128 // The complex value. panic("fail") Pipe *PipeNode // The command to evaluate as dot for the template. i32test(a, b, 256) type TemplateNode struct { if -a != a { // A Package collects information about the package we're going to write. o.Init(c, 'w') i64test(a, b, -7) b = a / -16 SizeofSockaddrInet6 = 0x1c type Package struct { p.indent++ b = a / -128 SizeofIfMsghdr = 0x70 for _, n := range l.Nodes { Flags int32 Offset int64 return !v.IsNil() if p.Name == nil { i16test(a, b, -128) case itemCharConstant: n.Int64 = i b = a / 64 type Cmsghdr struct { type IfData struct { i16test(a, b, 256) type ActionNode struct { i64test(a, b, -6) t.Errorf("Get() failed.") NodeType b = a / -20 func newString(orig, text string) *StringNode { CgoFlags: make(map[string]string), b = a / 6 return Text{ } // Use of this source code is governed by a BSD-style } } Pad_cgo_1 [4]byte if !ok { if n <= 0 { if !n.IsInt && !n.IsUint && !n.IsFloat { // A Ref refers to an expression of the form C.xxx in the AST. U uint32 var r io.Reader b = a / 64 func Print(fset *token.FileSet, x interface{}) (int, error) { b = a / 10 return a // Parse nodes. }, func i64test(a, b, c int64) { fset: fset, return update(crc, castagnoliTable, p) AST *ast.File // parsed AST i16test(a, b, 128) colors := NewMap("bike-shed-colors") // Imaginary constants can only be complex unless they are zero. return &IdentifierNode{NodeType: NodeIdentifier, Ident: ident} assert(i.Interface() == j.Interface()) Bsize uint32 } if i == len(args) { Addr [4]byte /* in_addr */ // This simulates in a small amount of code the behavior of Go's ideal constants. panic(err) return 0 // impossible return &FieldNode{NodeType: NodeField, Ident: strings.Split(ident[1:], ".")} // [1:] to drop leading period b = a / 4 b = a / -60 } return nodeEnd "fmt" SizeofIPMreq = 0x8 } // license that can be found in the LICENSE file. type Kevent_t struct { s := v.Field(2) b = a / -32 Ref []*Ref // all references to C.xxx in AST } i8test(a, b, -6) i16test(a, b, 1) os.Mkdir("_obj", 0777) } i16test(a, b, -256) `` + Nsignals int64 "amd64": 8, b = a / 1 a := uint32(rand.Uint32()) } func newElse(line int) *elseNode { type Fsid struct { b = a / 4 Pad_cgo_0 [2]byte if ptrSize == 0 { i32test(a, b, 20) b = a / -3 SizeofIfmaMsghdr2 = 0x14 t := x.Type() h := md5.New() Filler [4]uint32 NodeBool // A boolean constant. } Ixrss int64 Index uint16 AddError bool i16test(a, b, 4) b = a / 60 PTRACE_TRACEME = 0x0 i32test(a, b, -4) t.Errorf(`f.String() = %q, want %q`, s, exp) // TODO(rsc): // same slice or map. Code for general data structures probably "encoding/json" b = a / -3 return b = a / 128 a := uint16(rand.Uint32()) } func (l *ListNode) String() string { i16test(a, b, -5) } i32test(a, b, -5) // Parse flags for all files before translating due to CFLAGS. fset *token.FileSet var goarch, goos string i16test(a, b, 16) b = a / -20 NodeVariable // A $ variable. Ifindex uint32 } return (*r.Expr).Pos() u16run() i64test(a, b, 3) Hopcount uint32 if err := json.Unmarshal(jsonbytes, &jsondata); err != nil { if err != nil { func jsonenc() { u8test(a, b, 128) u32test(a, b, 5) for i := 0; i < Count; i++ { } if x := colors.m["blue"].(*Int).i; x != 4 { type Fbootstraptransfer_t struct { if x := colors.m["green"].(*Float).f; x != 4.125 { i8test(a, b, -3) p.indent-- func newEnd() *endNode { func u16rand() uint16 { // already and print the respective line number instead // struct fields for which f(fieldname, fieldvalue) is true are Family uint8 b = a / 32 Owner uint32 b = a / -16384 b = a / -2 i32run() case NodeIf: Kids []*JSONNode `json:"kids"` b = a / 4 panic(err) panic(err) Posmode int32 Physical uint8 import ( "testing" if !n.IsUint && float64(uint64(f)) == f { } i8test(a, b, 8) } u, err := strconv.ParseUint(text, 0, 64) // will fail for -0; fixed below. default: pkg := f.Package var x interface{} = []string{"a", "b"} ifaceeq(0x2aa7c0, 0x0, 0x0, 0x0, 0x2aa7c0, ...) if p.Name[k] == nil { a >>= uint(rand.Intn(16)) var a, b int32 n uint32 filter FieldFilter os.Exit(2) PtrSize: ptrSize, } } func TestMapCounter(t *testing.T) { i32test(a, b, -32) // Use the beginning of the md5 of the input to disambiguate. Locks uint32 Usec int32 } i32test(a, b, -1) b = a / -10 type IfaMsghdr struct { return &StringNode{NodeType: NodeString, Quoted: orig, Text: text} Port uint16 i16run() ) } return "{{<.>}}" nodeEnd // An end action. Not added to tree. u64test(a, b, 1) fs := make([]*File, len(goFiles)) u64test(a, b, 16) b = a / 10 u32test(a, b, 256) p := &Package{ } Family uint8 // symbols and which ones to use. SizeofBpfHdr = 0x14 i8test(a, b, -128) return fmt.Sprintf("{{template %q %s}}", t.Name, t.Pipe) if *godefs { Flags uint32 return fmt.Sprintf("%v := %v", p.Decl, p.Cmds) b = a / 8 Pipe *PipeNode // The pipeline in the action. type Dirent struct { } else { goarch = s b = a / 8 // localError wraps locally caught errors so we can distinguish fatalf("%s", err) return &ListNode{NodeType: NodeList} } p.writeOutput(f, input) Isrss int64 if d != b { func u64rand() uint64 { // Reset locale variables so gcc emits English errors [sic]. type BpfVersion struct { `urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a` + if err != nil { d := a / c panic("fail") const MAXDIM = 100 // check mem and string } Recvquota uint8 func (p *PipeNode) String() string { } src syscall.Handle // source var _ = c <- v // ERROR "send statement.*value.*select" Majflt int64 u16test(a, b, 16) Drop uint32 b = a / 7 SizeofIfaMsghdr = 0x14 Msglen uint16 } if reqs.f != 2.75 { n += m // Do integer test first so we get 0x123 etc. i8test(a, b, 1) } b = a / -6 Name map[string]*Name // accumulated Name from Files } Preamble string // C preamble (doc comment on import "C") GccOptions: gccOptions, } i64test(a, b, -60) Reclen uint16 Offset int64 func (p *Package) Record(f *File) { Usec int32 case NodeRange: func (b *BranchNode) String() string { } } else if !reflect.DeepEqual(p.Name[k], v) { } Nodes []Node // The element nodes in lexical order. for i := 0; i < Count; i++ { Pid int32 if reqs.i != -2 { i8test(a, b, 64) } Datalen uint32 n.IsFloat = true var dynout = flag.String("dynout", "", "write -dynobj output to this file") if line, exists := p.ptrmap[ptr]; exists { if err != nil { p.printf("%#q", s) Pad_cgo_0 [2]byte return nodeElse b = a / -7 i64test(a, b, -8) Typelen uint8 return fmt.Sprintf("(command: %v)", c.Args) j = v.Field(5) } Jt uint8 // Note: This code detects (some) cycles created via pointers but b = a / 8 n.IsInt = true } Rdev int32 // license that can be found in the LICENSE file. d := a / c var m int } } name := "" if err == nil { // not just a single byte. i16test(a, b, 2) } Sec int64 // The file contains the generic version of updateCastagnoli which just calls Blksize int32 t.Errorf("reqs.String() = %q, want \"4\"", s) } n := &NumberNode{NodeType: NodeNumber, Text: text} `Atom-Powered Robots Run Amok` + i16test(a, b, 60) for i := 0; i < b.N; i++ { var v int u8test(a, b, 60) b = a / 5 u8test(a, b, 6) i32test(a, b, 64) // license that can be found in the LICENSE file. b = a / 20 i64test(a, b, 60) i16test(a, b, 32) if ok { Size int64 u32test(a, b, 16) flag.Parse() b = a / 7 if err == nil { i8test(a, b, 4) Addr RawSockaddr ptrmap map[interface{}]int // *T -> line number } } var ptrSizeMap = map[string]int64{ Pad_cgo_0 [4]byte // them from genuine panics which we don't want to return as errors. b = a / 10 b = a / 7 SizeofSockaddrDatalink = 0x14 Length int64 var a, b int16 Ino uint64 b = a / -256 Qspare [2]int64 i32test(a, b, -16) import ( NodeIf // An if action. type NumberNode struct { import ( switch v := v.(type) { } Fssubtype uint32 if reqs.i != 4 { b = a / -20 b = a / 16 // make sure different values are different. reqs.Add(1.25) assert(i.Interface() == j.Interface()) ElseList *ListNode // What to execute if the value is empty (nil if absent). error_(token.NoPos, "inconsistent definitions for C.%s", k) "path/filepath" } } u32test(a, b, 64) if reqs.i != 0 { main·main() Len uint8 type Iovec struct { if p.PackageName == "" { "os" // and dumps information about the imported symbols and the u32run() b = a / 4 var a, b uint16 } if s, ok := x.Interface().([]byte); ok { println("u16", a, b, c, d) } i16test(a, b, -2) b = a / 256 b = a / 16384 // instead of needing to make the linkers duplicate all the Noproto uint32 return &PipeNode{NodeType: NodePipe, Line: line, Decl: decl} func init() { p.printf("nil") } b = a / 16384 t.Errorf("colors.String() isn't valid JSON: %v", err) } Interface [4]byte /* in_addr */ u16test(a, b, 32) } return 0, nil, false Id: "urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a", for i = len(args); i > 0; i-- { Iov *Iovec } b = a / -3 type Timespec struct { EnumValues map[string]int64 } r = bzip2.NewReader(r) } b = a / -64 Pad_cgo_0 [2]byte Ierrors uint32 SizeofBpfVersion = 0x4 b = a / -128 // CommandNode holds a command (a pipeline inside an evaluating action). Iovlen int32 Pid int32 } type IdentifierNode struct { return &WithNode{BranchNode{NodeType: NodeWith, Line: line, Pipe: pipe, List: list, ElseList: elseList}} fmt.Fprintf(os.Stderr, "cgo: cannot use -cdefs and -godefs together\n") return fmt.Sprintf("I=%s", i.Ident) n.IsComplex = true p.printf("}") // Print prints x to standard output, skipping nil fields. for i := 0; i < b.N; i++ { } t.Error("red.Kind() is not a number.") // IfNode represents an {{if}} action and its commands. sizeofPtr = 0x8 Line int // The line number in the input. for i := 2; i < *dim; i += 8 { _C_long int64 // values (file set specific offsets). Iqdrops uint32 Type uint8 } } // These flags are for bootstrapping a new Go implementation, goos = s if len(args) < 1 { b = a / 2 b = a / 127 i64test(a, b, 2) i8test(a, b, -32) b = a / -256 } type Inet6Pktinfo struct { // If a floating-point extraction succeeded, extract the int if needed. Use int32 SizeofSockaddrInet4 = 0x10 x.Z = x.Y func i8run() { b = a / -10 } import "math/rand" p.PackagePath = pkg "encoding/base64" for { for i, input := range goFiles { // } type BpfProgram struct { u64test(a, b, 32) } for _, cref := range f.Ref { if d != b { // Note that sendfile for windows does not suppport >2GB file. flag.Usage = usage i16test(a, b, -64) // it returns false otherwise. func newList() *ListNode { // BoolNode holds a boolean constant. Nivcsw int64 colors.Add("red", 2) return "{{end}}" i16test(a, b, 20) var indent = []byte(". ") Type uint8 if s := reqs.String(); s != "4" { for y := 0; y < 3; y++ { type Log2phys_t struct { return &TemplateNode{NodeType: NodeTemplate, Line: line, Name: name, Pipe: pipe} func newVariable(ident string) *VariableNode { b = a / 16384 `2003-12-13T18:30:02Z` + // Use of this source code is governed by a BSD-style b = a / -7 "386": 4, GccOptions []string u64test(a, b, 6) if err != nil { type FuncType struct { n.Uint64 = uint64(f) Rmx RtMetrics } func i32run() { Slen uint8 } Recvtiming uint32 i32test(a, b, 2) n.IsFloat = true i8test(a, b, 8) if nerrors > 0 { const ( Ident []string // The identifiers in lexical order. Updated: ParseTime("2003-12-13T18:30:02Z"), Devoffset int64 b = a / 2 var o sendfileOp Utime Timeval } Port uint16 n, err := fmt.Fprintf(p, format, args...) b = a / 60 t.Errorf("reqs.i = %v, want 0", reqs.i) x.U = 1 Opackets uint32 if !NotNilFilter("", x) { b = a / 3 ) i64test(a, b, 7) } if !strings.HasSuffix(args[i-1], ".go") { func (c *CommandNode) String() string { Len uint8 NodePipe // A pipeline of commands. b = a / 1 Pad [92]int8 u64test(a, b, 60) Buffer *byte } Len uint8 switch cref.Context { // fmt.Sscan can parse the pair, so let it do the work. b = a / 60 } c.Args = append(c.Args, arg) n.IsUint = true } p.last = b a >>= uint(rand.Intn(16)) // if handled == true, sendFile returns the number of bytes copied and any reqs.Add(-2) b = a / 64 Errno int32 func (p *PipeNode) append(command *CommandNode) { Multiaddr [16]byte /* in6_addr */ Zero [8]int8 Alen uint8 n.Int64 = int64(f) } i8test(a, b, 5) b = a / -1 switch v.Kind() { PackageName string // name of package } Z uint32 Len uint8 io.Copy(h, f) Pad_cgo_0 [2]byte } u8test(a, b, 7) } // make sure that _obj directory exists, so that we can write } os.Stdout.WriteString(p.godefs(f, input)) flag.Parse() p.printf("}") Len uint32 u32test(a, b, 2) p.PackageName = f.Package panic("fail") t.Errorf("name.s = %q, want \"\"", name.s) type WithNode struct { func updateCastagnoli(crc uint32, p []byte) uint32 { Mangle string // name used in generated Go type FieldNode struct { type RawSockaddrAny struct { } func (r *Ref) Pos() token.Pos { if *dynobj != "" { t.Errorf(`f.String() = %q, want %q`, s, exp) lr.N -= int64(done) type ( func TestInt(t *testing.T) { "reflect" i16test(a, b, 16384) } Type int16 throw: interface compare } } b = a / -20 type ListNode struct { // PipeNode holds a pipeline with optional declaration i64test(a, b, -3) i8test(a, b, 60) C string // name used in C type RangeNode struct { panic(err) p.printf("%s: ", name) Uid uint32 // RangeNode represents a {{range}} action and its commands. u16test(a, b, 7) a = i16rand() IsUint bool // Number has an unsigned integral value. Go *ast.FuncType return fmt.Sprintf("B=%t", b.True) b = a / -7 assert(i.Interface() != j.Interface()) i32test(a, b, -8) p.indent-- t.Errorf("colors.m[\"red\"] = %v, want 3", x) SizeofMsghdr = 0x30 // If an integer extraction succeeded, promote the float. Ident []string // Variable names in lexical order. Bfree uint64 return &IfNode{BranchNode{NodeType: NodeIf, Line: line, Pipe: pipe, List: list, ElseList: elseList}} } i8run() u32test(a, b, 10) b = a / -7 import ( Filter int16 i64test(a, b, -16384) func i16test(a, b, c int16) { i32test(a, b, 5) ) Stime Timeval u8test(a, b, 1) b = a / 20 b = a / -16 func (d *DotNode) Type() NodeType { for i := 0; i < *dim; i++ { b = a / -256 var gccgo = flag.Bool("gccgo", false, "generate files for use with gccgo") PackagePath string NodeNumber // A numerical constant. n.IsFloat = imag(n.Complex128) == 0 } if !ok { return fmt.Sprintf("(action: %v)", a.Pipe) "go/token" os.Exit(2) b = a / 32 var objDir = flag.String("objdir", "", "object directory") b = a / 6 // A Type collects information about a type in both the C and Go worlds. // cgo -godefs types_darwin.go List *ListNode // What to execute if the value is non-empty. */ } i16test(a, b, -10) fmt.Print("X") Reserved2 uint32 } output io.Writer m, ok := j.(map[string]interface{}) Type uint8 Result *Type ) b = a / -8 `` + b = a / 2 p.ParseFlags(f, input) p.printf("%v", v) jsonbytes []byte b = a / 2 type Name struct { Addr [16]byte /* in6_addr */ "runtime" // Such functions are identified in the Go input file `` + Repr string switch typ { _C_short int16 } Mtu uint32 // part of the name. i16test(a, b, -4) Type int32 i16test(a, b, 10) } } return n, nil type JSONNode struct { d := a / c NodeAction // A simple action such as field evaluation. } // WithNode represents a {{with}} action and its commands. Metric int32 } Bits [32]int32 // ListNode holds a sequence of nodes. } } // StringNode holds a string constant. The value has been "unquoted". p.printf("%d: ", i) F float32 b = a / 8 Nlink uint16 } "bytes" } NodeType } err := json.Unmarshal([]byte(s), &j) if d != b { b = a / 16384 i16test(a, b, -6) } Ipackets uint32 b = a / -1 for _, input := range goFiles { } func NotNilFilter(_ string, v reflect.Value) bool { filter: f, func i64rand() int64 { // usage() Name map[string]*Name // map from Go name to Name if tail != "'" { } fatalf("unknown $GOARCH %q", goarch) import ( b = a / 16384 u32test(a, b, 4) Bytesalloc int64 // Use of this source code is governed by a BSD-style // cgo -dynimport is essentially a separate helper command i8test(a, b, -8) i64test(a, b, -64) } IsComplex bool // Number is complex. func (b *BoolNode) String() string { a = (a << 32) | uint64(rand.Uint32()) Count int32 } } p.indent++ break } } if *objDir == "" { n.IsUint = float64(uint64(n.Float64)) == n.Float64 if err != nil { func (n *NumberNode) String() string { Gen uint32 } return nil, fmt.Errorf("malformed character constant: %s", text) func i8rand() int8 { type IPMreq struct { panic("fail") gccOptions := make([]string, len(args)) Data [14]int8 type BpfStat struct { CLWeight float64 `json:"cl_weight"` u32test(a, b, 1) if n.IsFloat { if !*godefs && !*cdefs { } S string b = a / -2 } } // Ctimespec Timespec Collisions uint32 p.printf("%s {\n", x.Type()) } name = "if" os.Exit(2) return a b = a / -2 // Use of this source code is governed by a BSD-style n.IsInt = true for i, b := range data { if n.IsUint { Type uint8 var dim = flag.Int("dim", 16, "board dimensions") i8test(a, b, -64) func (e *elseNode) String() string { Ident uint64 Dev int32 b = a / 6 } Addrs int32 for j := 2; j < *dim-3; j += 8 { } "go/ast" ptr := x.Interface() func u32run() { i8test(a, b, 3) // TextNode holds plain text. // are printed; all others are filtered from the output. u16test(a, b, 4) u16test(a, b, 1) Tstamp Timeval32 i := v.Field(0) if nerrors > 0 { a >>= uint(rand.Intn(8)) } FormatArgs []interface{} // A FieldFilter may be provided to Fprint to control the output. } PTRACE_KILL = 0x8 Baudrate uint32 switch x.Kind() { type IfNode struct { u64test(a, b, 3) jsondata JSONResponse Len int64 } Namlen uint16 Maxrss int64 sys·Goexit() // not cycles that are created via slices or maps containing the // license that can be found in the LICENSE file. p.printf("nil\n") Blocks int64 defer c.wio.Unlock() i32test(a, b, -3) *cref.Expr = cref.Name.Type.Go ) b = a / 60 // Copy the gcc options to a new slice so the list // Print(fset, x) is the same as Fprint(os.Stdout, fset, x, NotNilFilter). const ( b = a / -8 b = a / 6 n.Complex128 = complex(0, f) Params []*Type b = a / -10 Addrs int32 a >>= uint(rand.Intn(64)) type RtMetrics struct { if err := json.Unmarshal(jsonbytes, &r); err != nil { i64test(a, b, 16) Pad_cgo_0 [4]byte } panic("fail") goos = runtime.GOOS Iosize int32 i16test(a, b, -32) } p.ExpFunc = append(p.ExpFunc, f.ExpFunc...) } a >>= uint(rand.Intn(8)) // Copyright 2009 The Go Authors. All rights reserved. Addrs int32 var a, b uint8 return } b = a / -32 } err = e.(localError).err // re-panics if it's not a localError n.Uint64 = uint64(n.Float64) b = a / 3 b = a / 20 String() string t.Errorf("reqs.i = %v, want -2", reqs.i) reqs.Add(3) t.Errorf("reqs.f = %v, want 0", reqs.f) func main() { } assert(i.Interface() != j.Interface()) Mtu uint32 } b = a / 7 u8test(a, b, 184) return t "io" b = a / 5 // invariant: data[0:n] has been written i64test(a, b, 8) // colors.String() should be '{"red":3, "blue":4}', } else if p.PackageName != f.Package { red := m["red"] const ( for j := p.indent; j > 0; j-- { Files uint64 // Nodes. i16test(a, b, -16384) b = a / 16 } Tree *JSONNode `json:"tree"` } return Time(str) // NotNilFilter returns true for field values that are not nil; t.Errorf("colors.m[\"green\"] = %v, want 3.14", x) func (p *printer) print(x reflect.Value) { Interface uint32 return Line int // The line number in the input. Xmitquota uint8 type PipeNode struct { // to that file set. Otherwise positions are printed as integer b = a / -6 type BranchNode struct { jsondec() } func (p *printer) printf(format string, args ...interface{}) { } i32test(a, b, -64) x.W = 1 << 28 fmt.Fprint(b, n) var a, b int8 i64test(a, b, -20) line int // current line number ) } func Fprint(w io.Writer, fset *token.FileSet, x interface{}, f FieldFilter) (n int, err error) { } p.indent-- Imcasts uint32 } ) ExpName string // name to use from C } type _Socklen uint32 reqs := NewInt("requests") v := x.Interface() if x != 3 { NodeList // A list of Nodes. } os.Stdout.WriteString(p.cdefs(f, input)) var j interface{} func newBool(true bool) *BoolNode { } Username string `json:"username"` return type RawSockaddrDatalink struct { b = a / 10 i64test(a, b, 256) case "call", "call2": if name.s != "" { } } i8test(a, b, 6) Oerrors uint32 var dynobj = flag.String("dynimport", "", "if non-empty, print dynamic import data for that file") } c.incref() import "reflect" Birthtimespec Timespec r = base64.NewDecoder(base64.StdEncoding, r) ) p.indent++ Ffree uint64 } if _, err := fmt.Sscan(text, &n.Complex128); err != nil { var atomValue = &Feed{ V uint32 Ino uint64 func newWith(line int, pipe *PipeNode, list, elseList *ListNode) *WithNode { } } p.print(x.Index(i)) Ident string // The identifier's name. panic("fail") func NewIdentifier(ident string) *IdentifierNode { u32test(a, b, 32) var r JSONResponse fs[i] = f args := flag.Args() Data [12]int8 u32test(a, b, 8) if s, exp := f.String(), `["a","b"]`; s != exp { type Flock_t struct { Comments []*ast.CommentGroup // comments from file `` + x = 17 `` } ) return fmt.Sprintf("({{%s %s}} %s)", name, b.Pipe, b.List) n.Float64 = float64(n.Uint64) t := v.Field(3) } copy(gccOptions, args) SizeofCmsghdr = 0xc return n, nil Sec int64 cPrefix = fmt.Sprintf("_%x", h.Sum(nil)[0:6]) i32test(a, b, 60) return &VariableNode{NodeType: NodeVariable, Ident: strings.Split(ident, ".")} Version uint8 } return syscall.TransmitFile(o.fd.sysfd, o.src, o.n, 0, &o.o, nil, syscall.TF_WRITE_BEHIND) } i16test(a, b, -60) if b == '\n' { Title: "Example Feed", Flowinfo uint32 // print x n.IsInt = float64(int64(n.Float64)) == n.Float64 } func (e *elseNode) Type() NodeType { ) b = a / 60 Title: "Atom-Powered Robots Run Amok", } p.printf("\n") Sendpipe uint32 if n.IsInt { X uint32 _ = r { u32test(a, b, 7) } } mainstart+0xf /Users/rsc/goX/src/runtime/amd64/asm.s:53 a := int16(rand.Uint32()) // license that can be found in the LICENSE file. ptrSize := ptrSizeMap[goarch] Text string // The string, after quote processing. `urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6` + } case token.Pos: panic("assert") // system call to minimize copies. if reqs.f != 0.75 { Index uint16 type IfmaMsghdr struct { func i8test(a, b, c int8) { Onoff int32 } t.Errorf("reqs.String() = %q, want \"4.64\"", s) NodeType for { p.print(reflect.ValueOf(x)) // Copyright 2010 The Go Authors. All rights reserved. Flags int32 Lastchange Timeval32 d := a / c // A ExpFunc is an exported function, callable from C. Index uint16 var cPrefix string i8test(a, b, -1) dynimport(*dynobj) } } println("i32", a, b, c, d) for j := 0; j < *dim; j++ { u8test(a, b, 5) p.print(x.MapIndex(key)) panic("fail") b = a / 32 func i32test(a, b, c int32) { if reqs != Get("requests").(*Int) { a[i**dim+j+y] = 1 if reqs != Get("requests-float").(*Float) { } Linger int32 Pad_cgo_0 [4]byte "go/token" // DotNode holds the special identifier '.'. It is represented by a nil pointer. Entry: []Entry{ // Use of this source code is governed by a BSD-style // to generate Go and C headers that match the data layout and sizeofInt = 0x4 } // Use of this source code is governed by a BSD-style b = a / 60 i8test(a, b, -2) // These all require that the imaginary part be zero. // license that can be found in the LICENSE file. } type Rlimit struct { } func (c *CommandNode) append(arg Node) { func (d *DotNode) String() string { println("u64", a, b, c, d) var a, b int64 func sendFile(c *netFD, r io.Reader) (written int64, err error, handled bool) { u8test(a, b, 2) xtest() } `Example Feed` + } if err != nil { } func newRange(line int, pipe *PipeNode, list, elseList *ListNode) *RangeNode { type TypeRepr struct { NodeTemplate // A template invocation action. // sendFile copies the contents of r to c using the TransmitFile /* u64test(a, b, 10) i64test(a, b, -256) Reserved1 uint32 n.IsFloat = true for i := 0; i < Count; i++ { Msglen uint16 "io" } Func *ast.FuncDecl } return a println("i64", a, b, c, d) if d != b { Blocks uint64 func (s *StringNode) String() string { i = v.Field(4) Udata *byte // imported libraries. The Make.pkg rules for cgo prepare an } func TestFloat(t *testing.T) { a = (a << 32) | int64(rand.Uint32()) b = a / 1 n.Float64 = float64(rune) // odd but those are the rules. } else if p.last == '\n' { var godefs = flag.Bool("godefs", false, "for bootstrap: write Go definitions for C file to standard output") Cur uint64 d := a / c } Nlen uint8 var ( Inblock int64 // type-checked ASTs may contain cycles - use ptrmap Base *byte Msgsnd int64 Nsec int64 p := newPackage(args[:i]) } func (p *printer) Write(data []byte) (n int, err error) { const ( Pksent uint32 b = a / 6 Fflags uint32 func (o *sendfileOp) Submit() (err error) { Obytes uint32 Flags int32 i8test(a, b, -5) _, err = fmt.Fprintf(p.output, "%6d ", p.line) } Author: Person{Name: "John Doe"}, f.Close() var importRuntimeCgo = flag.Bool("import_runtime_cgo", true, "import runtime/cgo in generated code") } b = a / -4 NodeType // b = a / -64 } T string case reflect.Struct: // built into the cgo binary. It scans a gcc-produced executable Line int // The line number in the input. ptrmap: make(map[interface{}]int), i, err := strconv.ParseInt(text, 0, 64) u32test(a, b, 20) i16test(a, b, 5) return 0 // impossible colors.AddFloat("green", 4.125) p.printf("}") // It does not appear in the final parse tree. n.IsUint = true return &CommandNode{NodeType: NodeCommand} b = a / 2 // NodeType identifies the type of a parse tree node. SizeofBpfInsn = 0x8 } err error } if s := name.String(); s != "\"Mike\"" { // The period is dropped from each ident. } if !ok { } b = a / 32 u64test(a, b, 20) t.Errorf("Get() failed.") type Ref struct { } panic("unknown branch type") if -a != a { // Find first arg that looks like a go file and assume everything before b = a / -3 p.printf("\n") NodeRange // A range action. // A node is an element in the parse tree. The interface is trivial. Type() NodeType n.Int64 = int64(rune) Nswap int64 func i16run() { i64test(a, b, -4) }() p.printf("(obj @ %d)", line) } Len uint32 Link: []Link{{Href: "http://example.org/"}}, Hwassist uint32 Start int64 type ExpFunc struct { a := int32(rand.Uint32()) Pad_cgo_0 [4]byte n.simplifyComplex() u64run() return NodeDot return func (t NodeType) Type() NodeType { for i := 0; i < Count; i++ { i64test(a, b, 4) Refcount int32 } } d := a / c i32test(a, b, 16384) } // Use of this source code is governed by a BSD-style type Radvisory_t struct { break f := new(File) NodeType Level int32 // This file contains printing suppport for ASTs. n.simplifyComplex() } u16test(a, b, 256) i16test(a, b, -16) Mntfromname [1024]int8 type Statfs_t struct { return "{{else}}" b = a / -4 // ones such as field evaluations. name := t.Field(i).Name i64test(a, b, -5) } Line int // The line number in the input. Family uint8 lr, ok := r.(*io.LimitedReader) // ActionNode holds an action (something bounded by delimiters). import ( u8run() func u64run() { x, ok := red.(float64) main·main+0x190 /Users/rsc/goX/src/cmd/gc/x.go:10 // +build 386 arm panic PC=0x28ceb8 [1] u16test(a, b, 2) // the software implementation. p.ptrmap[ptr] = p.line func i16rand() int16 { // NewIdentifier returns a new IdentifierNode with the given identifier name. Body: text, // Emit correct line number annotations. for i := 0; i < Count; i++ { i64test(a, b, 10) b = a / -60 b = a / -5 "io/ioutil" i64test(a, b, -2) i32test(a, b, -60) const Count = 1e5 i64test(a, b, 64) func xtest() { } b = a / -32 b = a / 10 PTRACE_CONT = 0x7 anOp sizeofLongLong = 0x8 } } i32test(a, b, 32) // Use of this source code is governed by a BSD-style // Record what needs to be recorded about f. } f := Func(func() interface{} { return x }) v := reflect.ValueOf(x) i32test(a, b, 7) Summary: NewText("Some text."), return "TransmitFile" a = u32rand() "encoding/json" return s + t return Fprint(os.Stdout, fset, x, NotNilFilter) *objDir = "_obj" Data int64 _ = buf x.V = 2 t.Errorf("colors.m[\"blue\"] = %v, want 4", x) SizeofIfData = 0x60 d := a / c if p.fset != nil { u8test(a, b, 8) Msglen uint16 for i, n := 0, t.NumField(); i < n; i++ { Recv uint32 p.print(x.Elem()) i64test(a, b, -16) } if e := recover(); e != nil { throw(0x3014a, 0x0) _C_int int32 b = a / 1 n.Uint64 = uint64(rune) b = a / -8 } Y uint32 a = i8rand() flag.PrintDefaults() name = "range" NodeIdentifier // An identifier; always a function name. // TemplateNode represents a {{template}} action. i64test(a, b, 32) value := x.Field(i)