Source file test/fixedbugs/issue34966.go

     1  // compile -d=checkptr
     2  
     3  // Copyright 2019 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.
     6  
     7  package p
     8  
     9  import "unsafe"
    10  
    11  type ptr unsafe.Pointer
    12  
    13  func f(p ptr) *int { return (*int)(p) }
    14  func g(p ptr) ptr  { return ptr(uintptr(p) + 1) }
    15  

View as plain text