]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/compile/internal/test/inl_test.go
runtime: fix user arena heap bits writing on big endian platforms
[gostls13.git] / src / cmd / compile / internal / test / inl_test.go
index c73f49eeb7ff45edc8be858c3f6f3e160821e867..ea7f317ef52aac34cfe4dcc79061f797fdd6545d 100644 (file)
@@ -6,12 +6,10 @@ package test
 
 import (
        "bufio"
-       "internal/buildcfg"
        "internal/goexperiment"
        "internal/testenv"
        "io"
        "math/bits"
-       "os/exec"
        "regexp"
        "runtime"
        "strings"
@@ -53,6 +51,7 @@ func TestIntendedInlining(t *testing.T) {
                        "getMCache",
                        "isDirectIface",
                        "itabHashFunc",
+                       "nextslicecap",
                        "noescape",
                        "pcvalueCacheKey",
                        "readUnaligned32",
@@ -74,11 +73,13 @@ func TestIntendedInlining(t *testing.T) {
                        "gclinkptr.ptr",
                        "guintptr.ptr",
                        "writeHeapBitsForAddr",
+                       "heapBitsSlice",
                        "markBits.isMarked",
                        "muintptr.ptr",
                        "puintptr.ptr",
                        "spanOf",
                        "spanOfUnchecked",
+                       "typePointers.nextFast",
                        "(*gcWork).putFast",
                        "(*gcWork).tryGetFast",
                        "(*guintptr).set",
@@ -87,8 +88,11 @@ func TestIntendedInlining(t *testing.T) {
                        "(*mspan).base",
                        "(*mspan).markBitsForBase",
                        "(*mspan).markBitsForIndex",
+                       "(*mspan).writeUserArenaHeapBits",
                        "(*muintptr).set",
                        "(*puintptr).set",
+                       "(*wbBuf).get1",
+                       "(*wbBuf).get2",
                },
                "runtime/internal/sys": {},
                "runtime/internal/math": {
@@ -107,6 +111,9 @@ func TestIntendedInlining(t *testing.T) {
                        "(*Buffer).UnreadByte",
                        "(*Buffer).tryGrowByReslice",
                },
+               "internal/abi": {
+                       "UseInterfaceSwitchCache",
+               },
                "compress/flate": {
                        "byLiteral.Len",
                        "byLiteral.Less",
@@ -124,6 +131,9 @@ func TestIntendedInlining(t *testing.T) {
                        "AppendRune",
                        "ValidRune",
                },
+               "unicode/utf16": {
+                       "Decode",
+               },
                "reflect": {
                        "Value.Bool",
                        "Value.Bytes",
@@ -177,6 +187,15 @@ func TestIntendedInlining(t *testing.T) {
                "net": {
                        "(*UDPConn).ReadFromUDP",
                },
+               "sync": {
+                       // Both OnceFunc and its returned closure need to be inlinable so
+                       // that the returned closure can be inlined into the caller of OnceFunc.
+                       "OnceFunc",
+                       "OnceFunc.func2", // The returned closure.
+                       // TODO(austin): It would be good to check OnceValue and OnceValues,
+                       // too, but currently they aren't reported because they have type
+                       // parameters and aren't instantiated in sync.
+               },
                "sync/atomic": {
                        // (*Bool).CompareAndSwap handled below.
                        "(*Bool).Load",
@@ -207,7 +226,10 @@ func TestIntendedInlining(t *testing.T) {
                        "(*Uintptr).Load",
                        "(*Uintptr).Store",
                        "(*Uintptr).Swap",
-                       // (*Pointer[T])'s methods' handled below.
+                       "(*Pointer[go.shape.int]).CompareAndSwap",
+                       "(*Pointer[go.shape.int]).Load",
+                       "(*Pointer[go.shape.int]).Store",
+                       "(*Pointer[go.shape.int]).Swap",
                },
        }
 
@@ -233,14 +255,6 @@ func TestIntendedInlining(t *testing.T) {
                // (*Bool).CompareAndSwap is just over budget on 32-bit systems (386, arm).
                want["sync/atomic"] = append(want["sync/atomic"], "(*Bool).CompareAndSwap")
        }
-       if buildcfg.Experiment.Unified {
-               // Non-unified IR does not report "inlining call ..." for atomic.Pointer[T]'s methods.
-               // TODO(cuonglm): remove once non-unified IR frontend gone.
-               want["sync/atomic"] = append(want["sync/atomic"], "(*Pointer[go.shape.int]).CompareAndSwap")
-               want["sync/atomic"] = append(want["sync/atomic"], "(*Pointer[go.shape.int]).Load")
-               want["sync/atomic"] = append(want["sync/atomic"], "(*Pointer[go.shape.int]).Store")
-               want["sync/atomic"] = append(want["sync/atomic"], "(*Pointer[go.shape.int]).Swap")
-       }
 
        switch runtime.GOARCH {
        case "386", "wasm", "arm":
@@ -279,7 +293,7 @@ func TestIntendedInlining(t *testing.T) {
        }
 
        args := append([]string{"build", "-gcflags=-m -m", "-tags=math_big_pure_go"}, pkgs...)
-       cmd := testenv.CleanCmdEnv(exec.Command(testenv.GoToolPath(t), args...))
+       cmd := testenv.CleanCmdEnv(testenv.Command(t, testenv.GoToolPath(t), args...))
        pr, pw := io.Pipe()
        cmd.Stdout = pw
        cmd.Stderr = pw
@@ -362,7 +376,7 @@ func TestIssue56044(t *testing.T) {
        for _, mode := range modes {
                // Build the Go runtime with "-m", capturing output.
                args := []string{"build", "-gcflags=runtime=-m", "runtime"}
-               cmd := exec.Command(testenv.GoToolPath(t), args...)
+               cmd := testenv.Command(t, testenv.GoToolPath(t), args...)
                b, err := cmd.CombinedOutput()
                if err != nil {
                        t.Fatalf("build failed (%v): %s", err, b)
@@ -371,7 +385,7 @@ func TestIssue56044(t *testing.T) {
 
                // Redo the build with -cover, also with "-m".
                args = []string{"build", "-gcflags=runtime=-m", mode, "runtime"}
-               cmd = exec.Command(testenv.GoToolPath(t), args...)
+               cmd = testenv.Command(t, testenv.GoToolPath(t), args...)
                b, err = cmd.CombinedOutput()
                if err != nil {
                        t.Fatalf("build failed (%v): %s", err, b)