mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 21:15:39 +00:00
1af26222b6
Now that Go 1.17 has module graph pruning (https://go.dev/doc/go1.17#go-command), we should be able to use upstream netstack without breaking our private repo's build that then depends on the tailscale.com Go module. This is that experiment. Updates #1518 (the original bug to break out netstack to own module) Updates #2642 (this updates netstack, but doesn't remove workaround) Change-Id: I27a252c74a517053462e5250db09f379de8ac8ff Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
33 lines
737 B
Go
33 lines
737 B
Go
// Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package archtest
|
|
|
|
import (
|
|
"runtime"
|
|
"testing"
|
|
|
|
"gvisor.dev/gvisor/pkg/atomicbitops"
|
|
)
|
|
|
|
// tests netstack's AlignedAtomicInt64.
|
|
func TestAlignedAtomicInt64(t *testing.T) {
|
|
type T struct {
|
|
A atomicbitops.AlignedAtomicInt64
|
|
x int32
|
|
B atomicbitops.AlignedAtomicInt64
|
|
}
|
|
|
|
t.Logf("I am %v/%v\n", runtime.GOOS, runtime.GOARCH)
|
|
var x T
|
|
x.A.Store(1)
|
|
x.B.Store(2)
|
|
if got, want := x.A.Load(), int64(1); got != want {
|
|
t.Errorf("A = %v; want %v", got, want)
|
|
}
|
|
if got, want := x.B.Load(), int64(2); got != want {
|
|
t.Errorf("A = %v; want %v", got, want)
|
|
}
|
|
}
|