]> Cypherpunks.ru repositories - gostls13.git/blobdiff - test/nosplit.go
cmd/compile/internal/inline: score call sites exposed by inlines
[gostls13.git] / test / nosplit.go
index 9cedb93ec360436c045af5291c724d19eba7126d..e171d1da6618ec649274f36d5fed8d76ebb4a38f 100644 (file)
@@ -1,6 +1,7 @@
-// +build !nacl,!js,!aix,!gcflags_noopt,gc
 // run
 
+//go:build !nacl && !js && !aix && !wasip1 && !gcflags_noopt && gc
+
 // Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
@@ -284,6 +285,9 @@ TestCases:
                case "mips64", "mips64le":
                        ptrSize = 8
                        fmt.Fprintf(&buf, "#define REGISTER (R0)\n")
+               case "loong64":
+                       ptrSize = 8
+                       fmt.Fprintf(&buf, "#define REGISTER (R0)\n")
                case "ppc64", "ppc64le":
                        ptrSize = 8
                        fmt.Fprintf(&buf, "#define REGISTER (CTR)\n")
@@ -339,22 +343,15 @@ TestCases:
                                nosplit := m[3]
                                body := m[4]
 
-                               // The limit was originally 128 but is now 800 (928-128).
+                               // The limit was originally 128 but is now 800.
                                // Instead of rewriting the test cases above, adjust
                                // the first nosplit frame to use up the extra bytes.
                                // This isn't exactly right because we could have
                                // nosplit -> split -> nosplit, but it's good enough.
                                if !adjusted && nosplit != "" {
+                                       const stackNosplitBase = 800 // internal/abi.StackNosplitBase
                                        adjusted = true
-                                       size += (928 - 128) - 128
-                                       // Noopt builds have a larger stackguard.
-                                       // See ../src/cmd/dist/buildruntime.go:stackGuardMultiplier
-                                       // This increase is included in objabi.StackGuard
-                                       for _, s := range strings.Split(os.Getenv("GO_GCFLAGS"), " ") {
-                                               if s == "-N" {
-                                                       size += 928
-                                               }
-                                       }
+                                       size += stackNosplitBase - 128
                                }
 
                                if nosplit != "" {