summaryrefslogtreecommitdiffstats
path: root/test/fixedbugs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-08 04:09:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-08 04:09:35 +0000
commit14eb78c08c384545949758f2c00d8d44f06309a4 (patch)
treea33eb094d8630008a906374b2b30b627f237820b /test/fixedbugs
parentReleasing progress-linux version 1.21.10-1~progress7.99u1. (diff)
downloadgolang-1.21-14eb78c08c384545949758f2c00d8d44f06309a4.tar.xz
golang-1.21-14eb78c08c384545949758f2c00d8d44f06309a4.zip
Merging upstream version 1.21.11.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/fixedbugs')
-rw-r--r--test/fixedbugs/issue67160.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/fixedbugs/issue67160.go b/test/fixedbugs/issue67160.go
new file mode 100644
index 0000000..be45a61
--- /dev/null
+++ b/test/fixedbugs/issue67160.go
@@ -0,0 +1,32 @@
+// run
+
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test to make sure that we don't try using larger loads for
+// generated equality functions on architectures that can't do
+// unaligned loads.
+
+package main
+
+// T has a big field that wants to be compared with larger loads/stores.
+// T is "special" because of the unnamed field, so it needs a generated equality function.
+// T is an odd number of bytes in size and has alignment 1.
+type T struct {
+ src [8]byte
+ _ byte
+}
+
+// U contains 8 copies of T, each at a different %8 alignment.
+type U [8]T
+
+//go:noinline
+func f(x, y *U) bool {
+ return *x == *y
+}
+
+func main() {
+ var a U
+ _ = f(&a, &a)
+}