From e3e0122ae269027bfd2e2db1dbf106883ad5a8a7 Mon Sep 17 00:00:00 2001 From: Todd Neal Date: Thu, 29 Oct 2015 21:45:19 -0500 Subject: test: use go:noinline consistently Replace various implementations of inlining prevention with "go:noinline" Change-Id: Iac90895c3a62d6f4b7a6c72e11e165d15a0abfa4 Reviewed-on: https://go-review.googlesource.com/16510 Reviewed-by: Keith Randall Run-TryBot: Todd Neal TryBot-Result: Gobot Gobot --- src/runtime/race/testdata/mop_test.go | 8 +------- src/runtime/race/testdata/regression_test.go | 9 ++------- 2 files changed, 3 insertions(+), 14 deletions(-) (limited to 'src/runtime/race/testdata') diff --git a/src/runtime/race/testdata/mop_test.go b/src/runtime/race/testdata/mop_test.go index d7cbc98f95..c96acb9021 100644 --- a/src/runtime/race/testdata/mop_test.go +++ b/src/runtime/race/testdata/mop_test.go @@ -1356,14 +1356,8 @@ type InterImpl struct { x, y int } +//go:noinline func (p InterImpl) Foo(x int) { - // prevent inlining - z := 42 - x = 85 - y := x / z - z = y * z - x = z * y - _, _, _ = x, y, z } type InterImpl2 InterImpl diff --git a/src/runtime/race/testdata/regression_test.go b/src/runtime/race/testdata/regression_test.go index d461269d98..6a7802fb02 100644 --- a/src/runtime/race/testdata/regression_test.go +++ b/src/runtime/race/testdata/regression_test.go @@ -65,10 +65,8 @@ type Image struct { min, max Rect } +//go:noinline func NewImage() Image { - var pleaseDoNotInlineMe stack - pleaseDoNotInlineMe.push(1) - _ = pleaseDoNotInlineMe.pop() return Image{} } @@ -113,11 +111,8 @@ type RpcChan struct { var makeChanCalls int +//go:noinline func makeChan() *RpcChan { - var pleaseDoNotInlineMe stack - pleaseDoNotInlineMe.push(1) - _ = pleaseDoNotInlineMe.pop() - makeChanCalls++ c := &RpcChan{make(chan bool, 1)} c.c <- true -- cgit v1.3-5-g9baa