mirror of
https://github.com/golang/go.git
synced 2026-08-02 20:44:20 +08:00
The compiler already folds several math/bits intrinsics with constant inputs. Add generic SSA folds for constant Reverse, ReverseBytes, and their narrower forms after they lower to BitRev and Bswap ops. This removes residual reverse instructions for constant arguments while leaving target-specific lowering unchanged for variable arguments. For #21872. Change-Id: I16d8192e9b900a8ded75cb51f411382e9c987880 Reviewed-on: https://go-review.googlesource.com/c/go/+/782462 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
The test directory contains tests of the Go tool chain and runtime. It includes black box tests, regression tests, and error output tests. They are run as part of all.bash.
To run just these tests, execute:
../bin/go test cmd/internal/testdir
To run just tests from specified files in this directory, execute:
../bin/go test cmd/internal/testdir -run='Test/(file1.go|file2.go|...)'
Standard library tests should be written as regular Go tests in the appropriate package.
The tool chain and runtime also have regular Go tests in their packages. The main reasons to add a new test to this directory are:
- it is most naturally expressed using the test runner; or
- it is also applicable to
gccgoand other Go tool chains.