Skip to content

Commit 73f987c

Browse files
cuonglmgopherbot
authored andcommitted
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>
1 parent 185766d commit 73f987c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/fixedbugs/issue53439.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// compile
2+
//go:build goexperiment.unified
3+
4+
// Copyright 2022 The Go Authors. All rights reserved.
5+
// Use of this source code is governed by a BSD-style
6+
// license that can be found in the LICENSE file.
7+
8+
package p
9+
10+
import "unsafe"
11+
12+
func F[T int](v T) uintptr {
13+
return unsafe.Offsetof(struct{ f T }{
14+
func(T) T { return v }(v),
15+
}.f)
16+
}
17+
18+
func f() {
19+
F(1)
20+
}

0 commit comments

Comments
 (0)