tools/go/pointer
Alan Donovan 8e53eb937b go/ssa: support custom TestMain functions in test packages
Supporting user-defined TestMain functions requires that we generate a
"testmain" package for each testable package, rather than a single one
for the entire program.  This entails these API changes:

1. (*ssa.Program).{CreateTestMainPackage,FindTests} both now
   accept only a single package.  Existing clients that pass them
   multiple packages must call them from a loop.

2. (*ssa.Program).FindTests returns an additional result, the the
   optional TestMain *ssa.Function.  Existing clients may discard it.

Also:
- Test the new logic using the SSA interpreter
- add ssautil.MainPackages helper
- callgraph: allow multiple main packages, and analyze them all
- ssadump -run: allow multiple main/test packages, and run each in a new interpreter
- minor simplifications to some callers (e.g. guru)

Fixes golang/go#9553

Change-Id: Ia7de9bd27448fb08b8d172ba5cdbcf37a762b7a0
Reviewed-on: https://go-review.googlesource.com/25102
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-10-19 17:50:59 +00:00
..
testdata x/tools: s/oracle/guru/g in various comments 2016-10-13 18:54:04 +00:00
TODO go.tools/go/pointer: eliminate TODOs regarding sound treatment of unsafe.Pointer. 2014-07-08 10:11:36 -04:00
analysis.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
api.go x/tools/...: fork and tag !1.5 all files that use go/types et al 2016-01-06 20:40:09 +00:00
callgraph.go go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
constraint.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
doc.go x/tools/...: fork and tag !1.5 all files that use go/types et al 2016-01-06 20:40:09 +00:00
example_test.go go/ssa: rename some API features (incompatible change) 2015-08-31 22:20:12 +00:00
gen.go go/pointer: clarify a comment 2016-04-01 17:12:30 +00:00
hvn.go x/tools: s/oracle/guru/g in various comments 2016-10-13 18:54:04 +00:00
intrinsics.go go/pointer: disable analysis of runtime package 2016-03-29 16:14:39 +00:00
labels.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
opt.go go/pointer: implement pointer equivalence via hash-value numbering, a pre-solver optimization. 2014-06-16 15:46:07 -04:00
pointer_test.go all: skip slow tests in short mode 2016-01-28 00:14:01 +00:00
print.go go/pointer: implement pointer equivalence via hash-value numbering, a pre-solver optimization. 2014-06-16 15:46:07 -04:00
reflect.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
solve.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
stdlib_test.go go/ssa: support custom TestMain functions in test packages 2016-10-19 17:50:59 +00:00
util.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00