diff options
| author | Todd Neal <todd@tneal.org> | 2015-10-29 21:45:19 -0500 |
|---|---|---|
| committer | Todd Neal <todd@tneal.org> | 2015-11-03 02:01:34 +0000 |
| commit | e3e0122ae269027bfd2e2db1dbf106883ad5a8a7 (patch) | |
| tree | c3313e876d4d10a4b340f0886305fb5cc60932d3 /src/runtime/race/testdata | |
| parent | ebafc80ebaa8d7e67ba72642eed67c0adfc0c0c3 (diff) | |
| download | go-e3e0122ae269027bfd2e2db1dbf106883ad5a8a7.tar.xz | |
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 <khr@golang.org>
Run-TryBot: Todd Neal <todd@tneal.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/race/testdata')
| -rw-r--r-- | src/runtime/race/testdata/mop_test.go | 8 | ||||
| -rw-r--r-- | src/runtime/race/testdata/regression_test.go | 9 |
2 files changed, 3 insertions, 14 deletions
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 |
