summaryrefslogtreecommitdiff
path: root/test/codegen/stack.go
diff options
context:
space:
mode:
authorAlberto Donizetti <alb.donizetti@gmail.com>2018-03-29 10:40:45 +0200
committerAlberto Donizetti <alb.donizetti@gmail.com>2018-03-30 08:08:06 +0000
commit3b0b8bcd6893742554c120bd3e30b350d3ec3fae (patch)
treecc8e3f18643ed1dd231302ae35729ac7fa845e85 /test/codegen/stack.go
parentf63250238be548b7c6c24ae840541102a5cfef99 (diff)
downloadgo-git-3b0b8bcd6893742554c120bd3e30b350d3ec3fae.tar.gz
test/codegen: port stack-related tests to codegen
And delete them from asm_test. Change-Id: Idfe1249052d82d15b9c30b292c78656a0bf7b48d Reviewed-on: https://go-review.googlesource.com/103315 Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'test/codegen/stack.go')
-rw-r--r--test/codegen/stack.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/codegen/stack.go b/test/codegen/stack.go
new file mode 100644
index 0000000000..987d6a5b1f
--- /dev/null
+++ b/test/codegen/stack.go
@@ -0,0 +1,24 @@
+// asmcheck
+
+// Copyright 2018 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.
+
+package codegen
+
+// This file contains code generation tests related to the use of the
+// stack.
+
+// check that stack stores are optimized away
+
+// 386:"TEXT\t.*, [$]0-4"
+// amd64:"TEXT\t.*, [$]0-8"
+// arm:"TEXT\t.*, [$]-4-4"
+// arm64:"TEXT\t.*, [$]-8-8"
+// s390x:"TEXT\t.*, [$]0-8"
+// ppc64le:"TEXT\t.*, [$]0-8"
+// mips:"TEXT\t.*, [$]-4-4"
+func StackStore() int {
+ var x int
+ return *(&x)
+}