]> 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 fb9195481aa3018b22a614e9954af18ecbff3734..ccc0864ca9d7e04364eac1659f2bc435c87ec80e 100644 (file)
@@ -5,6 +5,7 @@
 package runtime_test
 
 import (
+       "internal/goexperiment"
        "reflect"
        "runtime"
        "testing"
@@ -16,13 +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    any     // type as a value
                _32bit uintptr // size on 32bit platforms
                _64bit uintptr // size on 64bit platforms
        }{
-               {runtime.G{}, 252, 408},   // g, but exported for testing
-               {runtime.Sudog{}, 56, 88}, // sudog, 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 {