]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: fix inst_test.go for riscv5
authorDan Scales <danscales@google.com>
Wed, 13 Oct 2021 17:27:01 +0000 (10:27 -0700)
committerDan Scales <danscales@google.com>
Wed, 13 Oct 2021 20:31:25 +0000 (20:31 +0000)
On riscv5, apparently extra wrappers (trampolines) are created for some
functions with the suffix "-tramp". Modify inst_test.go to not match
these "-tramp" wrappers.

Change-Id: I754c724f03555c30f8e1b5cfc08152555bbbcf17
Reviewed-on: https://go-review.googlesource.com/c/go/+/355650
Run-TryBot: Dan Scales <danscales@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>

src/cmd/compile/internal/test/inst_test.go

index 59a67cb545ce6aa4f94148f365eb8f9864c29b82..951f6a05aa57df1a3daf55700f48eb760d47aa4f 100644 (file)
@@ -50,7 +50,9 @@ func TestInst(t *testing.T) {
        if output, err = cmd.CombinedOutput(); err != nil {
                t.Fatalf("Failed: %v:\nOut: %s\n", err, output)
        }
-       re := regexp.MustCompile(`\bSort\[.*shape.*\]`)
+       // Look for shape-based instantiation of Sort, but ignore any extra wrapper
+       // ending in "-tramp" (which are created on riscv).
+       re := regexp.MustCompile(`\bSort\[.*shape.*\][^-]`)
        r := re.FindAllIndex(output, -1)
        if len(r) != 1 {
                t.Fatalf("Wanted 1 instantiations of Sort function, got %d\n", len(r))