summaryrefslogtreecommitdiff
path: root/test/codegen/stack.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/codegen/stack.go')
-rw-r--r--test/codegen/stack.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/codegen/stack.go b/test/codegen/stack.go
index 987d6a5b1f..da5ef24e13 100644
--- a/test/codegen/stack.go
+++ b/test/codegen/stack.go
@@ -6,6 +6,8 @@
package codegen
+import "runtime"
+
// This file contains code generation tests related to the use of the
// stack.
@@ -22,3 +24,13 @@ func StackStore() int {
var x int
return *(&x)
}
+
+// Check that assembly output has matching offset and base register
+// (Issue #21064).
+
+// amd64:`.*b\+24\(SP\)`
+// arm:`.*b\+4\(FP\)`
+func check_asmout(a, b int) int {
+ runtime.GC() // use some frame
+ return b
+}