mirror of https://github.com/golang/go.git
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>
This commit is contained in:
parent
185766de0f
commit
73f987c88b
|
|
@ -0,0 +1,20 @@
|
|||
// 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)
|
||||
}
|
||||
Loading…
Reference in New Issue