// want extracts the contents of the first comment // section starting with "WANT:\n". The returned // content is split into lines without // prefix. func want(f *ast.File) []string { … } // testProg returns an ssa representation of a program at // `path`, assumed to define package "testdata," and the // test want result as list of strings. func testProg(t testing.TB, path string, mode ssa.BuilderMode) (*ssa.Program, []string, error) { … } // loadFile loads a built SSA package for a single-file package "x.io/testdata". // (Ideally all uses would be converted over to txtar files with explicit go.mod files.) // // TODO(adonovan): factor with similar loadFile in cha/cha_test.go. func loadFile(t testing.TB, filename string, mode ssa.BuilderMode) (*packages.Package, *ssa.Package) { … } func firstRegInstr(f *ssa.Function) ssa.Value { … } // funcName returns a name of the function `f` // prefixed with the name of the receiver type. func funcName(f *ssa.Function) string { … } // callGraphStr stringifes `g` into a list of strings where // each entry is of the form // // f: cs1 -> f1, f2, ...; ...; csw -> fx, fy, ... // // f is a function, cs1, ..., csw are call sites in f, and // f1, f2, ..., fx, fy, ... are the resolved callees. func callGraphStr(g *callgraph.Graph) []string { … } // Logs the functions of prog to t. func logFns(t testing.TB, prog *ssa.Program) { … }