runtime: scan register backing store on ia64
[official-gcc.git] / libgo / go / runtime / norace_test.go
blobe9b39b2f4553fa0d3dc1dde971654d0996958e54
1 // Copyright 2013 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // The file contains tests that cannot run under race detector for some reason.
6 // +build !race
8 package runtime_test
10 import (
11 "runtime"
12 "testing"
15 // Syscall tests split stack between Entersyscall and Exitsyscall under race detector.
16 func BenchmarkSyscall(b *testing.B) {
17 benchmarkSyscall(b, 0, 1)
20 func BenchmarkSyscallWork(b *testing.B) {
21 benchmarkSyscall(b, 100, 1)
24 func BenchmarkSyscallExcess(b *testing.B) {
25 benchmarkSyscall(b, 0, 4)
28 func BenchmarkSyscallExcessWork(b *testing.B) {
29 benchmarkSyscall(b, 100, 4)
32 func benchmarkSyscall(b *testing.B, work, excess int) {
33 b.SetParallelism(excess)
34 b.RunParallel(func(pb *testing.PB) {
35 foo := 42
36 for pb.Next() {
37 runtime.Entersyscall(0)
38 for i := 0; i < work; i++ {
39 foo *= 2
40 foo /= 2
42 runtime.Exitsyscall(0)
44 _ = foo