aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime/testdata
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-04-06 14:04:45 -0700
committerIan Lance Taylor <iant@golang.org>2020-04-06 16:37:24 -0700
commit52fa80f853c0b0f623ea9e4c7198e324ce44ff30 (patch)
treee2695726e95b7bd125d52b7bdd315cb0028854fa /libgo/go/runtime/testdata
parent749bd22ddc50b5112e5ed506ffef7249bf8e6fb3 (diff)
downloadgcc-52fa80f853c0b0f623ea9e4c7198e324ce44ff30.zip
gcc-52fa80f853c0b0f623ea9e4c7198e324ce44ff30.tar.gz
gcc-52fa80f853c0b0f623ea9e4c7198e324ce44ff30.tar.bz2
libgo: update to almost the 1.14.2 release
Update to edea4a79e8d7dea2456b688f492c8af33d381dc2 which is likely to be approximately the 1.14.2 release. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/227377
Diffstat (limited to 'libgo/go/runtime/testdata')
-rw-r--r--libgo/go/runtime/testdata/testprog/checkptr.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/libgo/go/runtime/testdata/testprog/checkptr.go b/libgo/go/runtime/testdata/testprog/checkptr.go
index 177db38..45e6fb1 100644
--- a/libgo/go/runtime/testdata/testprog/checkptr.go
+++ b/libgo/go/runtime/testdata/testprog/checkptr.go
@@ -7,18 +7,25 @@ package main
import "unsafe"
func init() {
- register("CheckPtrAlignment", CheckPtrAlignment)
+ register("CheckPtrAlignmentNoPtr", CheckPtrAlignmentNoPtr)
+ register("CheckPtrAlignmentPtr", CheckPtrAlignmentPtr)
register("CheckPtrArithmetic", CheckPtrArithmetic)
register("CheckPtrSize", CheckPtrSize)
register("CheckPtrSmall", CheckPtrSmall)
}
-func CheckPtrAlignment() {
+func CheckPtrAlignmentNoPtr() {
var x [2]int64
p := unsafe.Pointer(&x[0])
sink2 = (*int64)(unsafe.Pointer(uintptr(p) + 1))
}
+func CheckPtrAlignmentPtr() {
+ var x [2]int64
+ p := unsafe.Pointer(&x[0])
+ sink2 = (**int64)(unsafe.Pointer(uintptr(p) + 1))
+}
+
func CheckPtrArithmetic() {
var x int
i := uintptr(unsafe.Pointer(&x))