3 // Copyright 2022 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
17 type S struct{ _ cgo.Incomplete }
20 p := (*S)(unsafe.Pointer(uintptr(0x8000)))
24 log.Fatalf("%p != %p", unsafe.Pointer(p), unsafe.Pointer(p2))
26 p2 = typeAssert[*S](v)
28 log.Fatalf("%p != %p from typeAssert", unsafe.Pointer(p), unsafe.Pointer(p2))
32 func typeAssert[T any](v any) T {