diff options
author | Keith Randall <khr@golang.org> | 2016-12-05 15:41:04 -0800 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2018-11-28 17:13:46 +0000 |
commit | 2b4f24a2d2cbdefe3cb578ef37804cf05c1f5b00 (patch) | |
tree | 2a8099e6ee362c39ad7c04eebae9fe28fd6bc827 /test/run.go | |
parent | ff9481ec0d684b4f00670d40e869b5d40c54f162 (diff) | |
download | go-2b4f24a2d2cbdefe3cb578ef37804cf05c1f5b00.tar.gz go-2b4f24a2d2cbdefe3cb578ef37804cf05c1f5b00.zip |
cmd/compile: randomize value order in block for testing
A little bit of compiler stress testing. Randomize the order
of the values in a block before every phase. This randomization
makes sure that we're not implicitly depending on that order.
Currently the random seed is a hash of the function name.
It provides determinism, but sacrifices some coverage.
Other arrangements are possible (env var, ...) but require
more setup.
Fixes #20178
Change-Id: Idae792a23264bd9a3507db6ba49b6d591a608e83
Reviewed-on: https://go-review.googlesource.com/c/33909
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'test/run.go')
-rw-r--r-- | test/run.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/run.go b/test/run.go index 39647d7252..e7976657de 100644 --- a/test/run.go +++ b/test/run.go @@ -559,6 +559,19 @@ func (t *test) run() { } args = args[1:] } + if action == "errorcheck" { + found := false + for i, f := range flags { + if strings.HasPrefix(f, "-d=") { + flags[i] = f + ",ssa/check/on" + found = true + break + } + } + if !found { + flags = append(flags, "-d=ssa/check/on") + } + } t.makeTempDir() if !*keep { |