From 3b0b8bcd6893742554c120bd3e30b350d3ec3fae Mon Sep 17 00:00:00 2001 From: Alberto Donizetti Date: Thu, 29 Mar 2018 10:40:45 +0200 Subject: 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 TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- test/codegen/stack.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/codegen/stack.go (limited to 'test/codegen') 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) +} -- cgit v1.3-5-g9baa