import (
. "bytes"
- "internal/testenv"
"io"
"math/rand"
- "os/exec"
"runtime"
"testing"
"unicode/utf8"
}
}
-// Test that tryGrowByReslice is inlined.
-// Only execute on "linux-amd64" builder in order to avoid breakage.
-func TestTryGrowByResliceInlined(t *testing.T) {
- targetBuilder := "linux-amd64"
- if testenv.Builder() != targetBuilder {
- t.Skipf("%q gets executed on %q builder only", t.Name(), targetBuilder)
- }
- t.Parallel()
- goBin := testenv.GoToolPath(t)
- out, err := exec.Command(goBin, "tool", "nm", goBin).CombinedOutput()
- if err != nil {
- t.Fatalf("go tool nm: %v: %s", err, out)
- }
- // Verify this doesn't exist:
- sym := "bytes.(*Buffer).tryGrowByReslice"
- if Contains(out, []byte(sym)) {
- t.Errorf("found symbol %q in cmd/go, but should be inlined", sym)
- }
-}
-
func BenchmarkWriteByte(b *testing.B) {
const n = 4 << 10
b.SetBytes(n)
"(*waitq).enqueue",
},
"runtime/internal/sys": {},
+ "bytes": {
+ "(*Buffer).Bytes",
+ "(*Buffer).Cap",
+ "(*Buffer).Len",
+ "(*Buffer).Next",
+ "(*Buffer).Read",
+ "(*Buffer).ReadByte",
+ "(*Buffer).Reset",
+ "(*Buffer).String",
+ "(*Buffer).UnreadByte",
+ "(*Buffer).tryGrowByReslice",
+ },
"unicode/utf8": {
"FullRune",
"FullRuneInString",