Source file test/codegen/unsafe.go
1 // asmcheck 2 3 // Copyright 2024 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 codegen 8 9 import "unsafe" 10 11 func f(p unsafe.Pointer, x, y uintptr) int64 { 12 p = unsafe.Pointer(uintptr(p) + x + y) 13 // amd64:`MOVQ\s\(.*\)\(.*\*1\), ` 14 // arm64:`MOVD\s\(R[0-9]+\)\(R[0-9]+\), ` 15 return *(*int64)(p) 16 } 17