cmd/asm/internal/asm: run riscv64 end-to-end tests for each profile

Currently, the end-to-end tests are only run for the profile set
via GORISCV64. Run each of the end-to-end tests for each profile,
increasing test coverage. Also rename tests to be RISCV64 specific,
rather than RISCV.

Change-Id: I15a70939064122c79ec5f2edcda1fa2a47c8cc95
Reviewed-on: https://go-review.googlesource.com/c/go/+/731921
Auto-Submit: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
This commit is contained in:
Joel Sing
2025-12-21 14:48:18 +11:00
committed by Gopher Robot
parent 8254d66eab
commit 2485a0bc2c

View File

@@ -491,16 +491,35 @@ func TestPPC64EndToEnd(t *testing.T) {
}
}
func TestRISCVEndToEnd(t *testing.T) {
testEndToEnd(t, "riscv64", "riscv64")
func testRISCV64AllProfiles(t *testing.T, testFn func(t *testing.T)) {
t.Helper()
defer func(orig int) { buildcfg.GORISCV64 = orig }(buildcfg.GORISCV64)
for _, goriscv64 := range []int{20, 22, 23} {
t.Run(fmt.Sprintf("rva%vu64", goriscv64), func(t *testing.T) {
buildcfg.GORISCV64 = goriscv64
testFn(t)
})
}
}
func TestRISCVErrors(t *testing.T) {
testErrors(t, "riscv64", "riscv64error")
func TestRISCV64EndToEnd(t *testing.T) {
testRISCV64AllProfiles(t, func(t *testing.T) {
testEndToEnd(t, "riscv64", "riscv64")
})
}
func TestRISCVValidation(t *testing.T) {
testErrors(t, "riscv64", "riscv64validation")
func TestRISCV64Errors(t *testing.T) {
testRISCV64AllProfiles(t, func(t *testing.T) {
testErrors(t, "riscv64", "riscv64error")
})
}
func TestRISCV64Validation(t *testing.T) {
testRISCV64AllProfiles(t, func(t *testing.T) {
testErrors(t, "riscv64", "riscv64validation")
})
}
func TestS390XEndToEnd(t *testing.T) {