tools/go/ssa
Alan Donovan e779aa49e3 go/ssa/interp: make tests fast and robust
The go/ssa/interp tests have been a maintenance nightmare for years
because the interpreter requires intrinsics for all low-level or
non-Go code functions, and the set of such functions in the standard
library naturally changes from day to day.

This CL finally drops support for interpreting real packages (which
has anyway been broken for ages) and restricts the test suite to small
programs that use a handful of simple functions in packages bytes,
strings, errors, runtime, reflect, and unicode. These functions are
declared in a tiny fake standard libary in testdata/src, and the
implementations of these functions are provided by interpreter
intrinsics that delegate to the real Go implementation---all their
parameters and results are basic datatypes.

The test suite is now very fast and should be easy to maintain going
forward. It is still possible that a change to some file in
$GOROOT/test/*.go adds a dependency to a symbol not present in our
standard library, but this is rare. I will either delete the test or
add the intrinsic on a case-by-case basis.

We no longer attempt to interpret major functionality like
fmt.Sprintf or "testing".

The interpreter always pretends to be in linux/amd64 mode.

Happy Christmas, Brad. ;)

Fixes golang/go#27292

Change-Id: I715cf63e3534e2e0dab4666a5d7c669bf1d92674
Reviewed-on: https://go-review.googlesource.com/c/tools/+/168898
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-22 17:29:27 +00:00
..
interp go/ssa/interp: make tests fast and robust 2019-03-22 17:29:27 +00:00
ssautil go/ssa/ssautil: add AllPackages method 2018-10-15 18:41:29 +00:00
testdata go/ssa: convert the objlookup tests to the new marker syntax 2018-12-13 15:12:02 +00:00
blockopt.go go.tools/go/ssa: don't attempt fusion on single-pred blocks with φ-nodes 2014-04-24 09:08:21 -04:00
builder.go x/tools: remove old renaming imports of go/constant as exact 2018-08-10 17:04:37 +00:00
builder_test.go go/ssa: eliminate dead φ-nodes in cycles 2017-02-22 01:23:56 +00:00
const.go x/tools: remove old renaming imports of go/constant as exact 2018-08-10 17:04:37 +00:00
create.go go/ssa: updates to support go/packages 2018-08-08 20:03:34 +00:00
doc.go go/ssa: updates to support go/packages 2018-08-08 20:03:34 +00:00
dom.go go.tools/go/ssa: use bytes.Buffer instead of io.Writer. 2014-01-28 17:48:10 -05:00
emit.go x/tools/go/ssa: Accept struct conversions that ignore tags 2017-06-02 20:57:42 +00:00
example_test.go go/ssa: fix vet issues 2018-11-05 21:34:10 +00:00
func.go tools: updates for minimum Go version 1.6 2017-02-07 21:06:19 +00:00
identical.go x/tools/go/ssa: Accept struct conversions that ignore tags 2017-06-02 20:57:42 +00:00
identical_17.go x/tools/go/ssa: Accept struct conversions that ignore tags 2017-06-02 20:57:42 +00:00
identical_test.go x/tools/go/ssa: Accept struct conversions that ignore tags 2017-06-02 20:57:42 +00:00
lift.go go/ssa: fix regression in φ-elimination 2017-06-15 18:36:17 +00:00
lvalue.go tools: updates for minimum Go version 1.6 2017-02-07 21:06:19 +00:00
methods.go go/ssa: updated inconsistent docs after Program.Method rename 2018-11-09 15:25:51 +00:00
mode.go go/ssa: make *BuilderMode satisfy flag.Value 2016-03-07 22:18:09 +00:00
print.go go/ssa: fix regression in φ-elimination 2017-06-15 18:36:17 +00:00
sanity.go go/ssa: fix vet issues 2018-11-05 21:34:10 +00:00
source.go go/ssa: fix import in comment 2019-03-12 14:13:10 +00:00
source_test.go go/ssa: convert the objlookup tests to the new marker syntax 2018-12-13 15:12:02 +00:00
ssa.go go/ssa: updated inconsistent docs after Program.Method rename 2018-11-09 15:25:51 +00:00
stdlib_test.go go/...: use recommended issue tracker URLs 2018-12-05 01:41:16 +00:00
testmain.go go/ssa: updates to support go/packages 2018-08-08 20:03:34 +00:00
testmain_test.go go/ssa: support custom TestMain functions in test packages 2016-10-19 17:50:59 +00:00
util.go tools: updates for minimum Go version 1.6 2017-02-07 21:06:19 +00:00
wrappers.go go/ssa: use correct type for variadic parameter in wrapper methods 2018-09-11 13:30:44 +00:00