1
0
mirror of https://github.com/golang/go synced 2024-11-18 09:44:50 -07:00
go/test/fixedbugs/issue53439.go
Cuong Manh Le 73f987c88b test: add regression test for issue 53439
Fixes #53439

Change-Id: I425af0f78153511034e4a4648f32ef8c9378a325
Reviewed-on: https://go-review.googlesource.com/c/go/+/449756
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
2022-11-11 14:48:29 +00:00

21 lines
357 B
Go

// compile
//go:build goexperiment.unified
// Copyright 2022 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.
package p
import "unsafe"
func F[T int](v T) uintptr {
return unsafe.Offsetof(struct{ f T }{
func(T) T { return v }(v),
}.f)
}
func f() {
F(1)
}