diff options
| author | Paul E. Murphy <murp@ibm.com> | 2023-01-25 11:53:10 -0600 |
|---|---|---|
| committer | Paul Murphy <murp@ibm.com> | 2023-01-27 18:24:12 +0000 |
| commit | 0301c6c3512561b85b48d0e167f3e405484f496f (patch) | |
| tree | 18ac5ab56f9115b0fc1d16f953d0d1ef11efd7fc /test/codegen/stack.go | |
| parent | 4b3726e99bec62e4a8b8e9cecc478b51ce0d4636 (diff) | |
| download | go-0301c6c3512561b85b48d0e167f3e405484f496f.tar.xz | |
test/codegen: combine trivial PPC64 tests into ppc64x
Use a small python script to consolidate duplicate
ppc64/ppc64le tests into a single ppc64x codegen test.
This makes small assumption that anytime two tests with
for different arch/variant combos exists, those tests
can be combined into a single ppc64x test.
E.x:
// ppc64le: foo
// ppc64le/power9: foo
into
// ppc64x: foo
or
// ppc64: foo
// ppc64le: foo
into
// ppc64x: foo
import glob
import re
files = glob.glob("codegen/*.go")
for file in files:
with open(file) as f:
text = [l for l in f]
i = 0
while i < len(text):
first = re.match("\s*// ?ppc64(le)?(/power[89])?:(.*)", text[i])
if first:
j = i+1
while j < len(text):
second = re.match("\s*// ?ppc64(le)?(/power[89])?:(.*)", text[j])
if not second:
break
if (not first.group(2) or first.group(2) == second.group(2)) and first.group(3) == second.group(3):
text[i] = re.sub(" ?ppc64(le|x)?"," ppc64x",text[i])
text=text[:j] + (text[j+1:])
else:
j += 1
i+=1
with open(file, 'w') as f:
f.write("".join(text))
Change-Id: Ic6b009b54eacaadc5a23db9c5a3bf7331b595821
Reviewed-on: https://go-review.googlesource.com/c/go/+/463220
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'test/codegen/stack.go')
| -rw-r--r-- | test/codegen/stack.go | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/test/codegen/stack.go b/test/codegen/stack.go index f28b4a3320..eebbbf1677 100644 --- a/test/codegen/stack.go +++ b/test/codegen/stack.go @@ -18,8 +18,7 @@ import "runtime" // arm:"TEXT\t.*, [$]-4-" // arm64:"TEXT\t.*, [$]0-" // mips:"TEXT\t.*, [$]-4-" -// ppc64:"TEXT\t.*, [$]0-" -// ppc64le:"TEXT\t.*, [$]0-" +// ppc64x:"TEXT\t.*, [$]0-" // s390x:"TEXT\t.*, [$]0-" func StackStore() int { var x int @@ -38,8 +37,7 @@ type T struct { // arm:"TEXT\t.*, [$]0-" (spills return address) // arm64:"TEXT\t.*, [$]0-" // mips:"TEXT\t.*, [$]-4-" -// ppc64:"TEXT\t.*, [$]0-" -// ppc64le:"TEXT\t.*, [$]0-" +// ppc64x:"TEXT\t.*, [$]0-" // s390x:"TEXT\t.*, [$]0-" func ZeroLargeStruct(x *T) { t := T{} @@ -53,8 +51,7 @@ func ZeroLargeStruct(x *T) { // amd64:"TEXT\t.*, [$]0-" // arm:"TEXT\t.*, [$]0-" (spills return address) // arm64:"TEXT\t.*, [$]0-" -// ppc64:"TEXT\t.*, [$]0-" -// ppc64le:"TEXT\t.*, [$]0-" +// ppc64x:"TEXT\t.*, [$]0-" // s390x:"TEXT\t.*, [$]0-" // Note: that 386 currently has to spill a register. func KeepWanted(t *T) { @@ -68,8 +65,7 @@ func KeepWanted(t *T) { // - arm & mips fail due to softfloat calls // amd64:"TEXT\t.*, [$]0-" // arm64:"TEXT\t.*, [$]0-" -// ppc64:"TEXT\t.*, [$]0-" -// ppc64le:"TEXT\t.*, [$]0-" +// ppc64x:"TEXT\t.*, [$]0-" // s390x:"TEXT\t.*, [$]0-" func ArrayAdd64(a, b [4]float64) [4]float64 { return [4]float64{a[0] + b[0], a[1] + b[1], a[2] + b[2], a[3] + b[3]} @@ -82,8 +78,7 @@ func ArrayAdd64(a, b [4]float64) [4]float64 { // arm:"TEXT\t.*, [$]0-" (spills return address) // arm64:"TEXT\t.*, [$]0-" // mips:"TEXT\t.*, [$]-4-" -// ppc64:"TEXT\t.*, [$]0-" -// ppc64le:"TEXT\t.*, [$]0-" +// ppc64x:"TEXT\t.*, [$]0-" // s390x:"TEXT\t.*, [$]0-" func ArrayInit(i, j int) [4]int { return [4]int{i, 0, j, 0} |
