tailscale/tstest/archtest/archtest_test.go
Andrew Lytvynov 1302bd1181
all: cleanup unused code, part 1 (#10661)
Run `staticcheck` with `U1000` to find unused code. This cleans up about
a half of it. I'll do the other half separately to keep PRs manageable.

Updates #cleanup

Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-12-20 14:50:30 -08:00

32 lines
622 B
Go

// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
package archtest
import (
"runtime"
"testing"
"gvisor.dev/gvisor/pkg/atomicbitops"
)
// tests netstack's AlignedAtomicInt64.
func TestAlignedAtomicInt64(t *testing.T) {
type T struct {
A atomicbitops.Int64
_ int32
B atomicbitops.Int64
}
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)
}
}