]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: add test for number of instantiations
authorDan Scales <danscales@google.com>
Tue, 10 Aug 2021 21:51:57 +0000 (14:51 -0700)
committerDan Scales <danscales@google.com>
Tue, 12 Oct 2021 20:53:52 +0000 (20:53 +0000)
commitac6d706a058de56e5817ea820df4ed59492adbdf
treec3e63c2c049b31040b21539882c7b55ebe0c2e54
parentd032b2b2c8235ef25275405f6655866f2c81661d
[dev.typeparams] cmd/compile: add test for number of instantiations

Add a test for a generic sort function, operating on several different
pointer types (across two packages), so they should all share the same
shape-based instantiation. Actually check that only one instantiation of
Sort is created using 'go tool nm', and also check that the output is
correct.

In order to do the test on the executable using 'go nm', added this as a
'go test' in cmd/compile/internal/test.

Added the genembed.go test that I meant to include with a previous CL.

Change-Id: I9962913c2f1809484c2b1dfef3b07e4c8770731c
Reviewed-on: https://go-review.googlesource.com/c/go/+/354696
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/test/inst_test.go [new file with mode: 0644]
src/cmd/compile/internal/test/testdata/mysort/mysort.go [new file with mode: 0644]
src/cmd/compile/internal/test/testdata/ptrsort.go [new file with mode: 0644]
src/cmd/compile/internal/test/testdata/ptrsort.out [new file with mode: 0644]
test/typeparam/genembed.go [new file with mode: 0644]