aboutsummaryrefslogtreecommitdiff
path: root/go/callgraph/vta/helpers_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/callgraph/vta/helpers_test.go')
-rw-r--r--go/callgraph/vta/helpers_test.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/go/callgraph/vta/helpers_test.go b/go/callgraph/vta/helpers_test.go
index 0e00aeb28..768365f5b 100644
--- a/go/callgraph/vta/helpers_test.go
+++ b/go/callgraph/vta/helpers_test.go
@@ -35,7 +35,7 @@ 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(path string) (*ssa.Program, []string, error) {
+func testProg(path string, mode ssa.BuilderMode) (*ssa.Program, []string, error) {
content, err := ioutil.ReadFile(path)
if err != nil {
return nil, nil, err
@@ -56,7 +56,7 @@ func testProg(path string) (*ssa.Program, []string, error) {
return nil, nil, err
}
- prog := ssautil.CreateProgram(iprog, 0)
+ prog := ssautil.CreateProgram(iprog, mode)
// Set debug mode to exercise DebugRef instructions.
prog.Package(iprog.Created[0].Pkg).SetDebugMode(true)
prog.Build()
@@ -87,7 +87,9 @@ 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: 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 {