]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/runtime/sizeof_test.go
runtime: add execution tracer v2 behind GOEXPERIMENT=exectracer2
[gostls13.git] / src / runtime / sizeof_test.go
index 830055e2aa93ddffc7f7079714292b21950e58d4..ccc0864ca9d7e04364eac1659f2bc435c87ec80e 100644 (file)
@@ -2,11 +2,10 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !nacl
-
 package runtime_test
 
 import (
+       "internal/goexperiment"
        "reflect"
        "runtime"
        "testing"
@@ -18,12 +17,18 @@ import (
 func TestSizeof(t *testing.T) {
        const _64bit = unsafe.Sizeof(uintptr(0)) == 8
 
+       g32bit := uintptr(252)
+       if goexperiment.ExecTracer2 {
+               g32bit = uintptr(256)
+       }
+
        var tests = []struct {
-               val    interface{} // type as a value
-               _32bit uintptr     // size on 32bit platforms
-               _64bit uintptr     // size on 64bit platforms
+               val    any     // type as a value
+               _32bit uintptr // size on 32bit platforms
+               _64bit uintptr // size on 64bit platforms
        }{
-               {runtime.G{}, 216, 376}, // g, but exported for testing
+               {runtime.G{}, g32bit, 408}, // g, but exported for testing
+               {runtime.Sudog{}, 56, 88},  // sudog, but exported for testing
        }
 
        for _, tt := range tests {