aboutsummaryrefslogtreecommitdiff
path: root/test/reorder2.go
diff options
context:
space:
mode:
authorTodd Neal <todd@tneal.org>2015-10-29 21:45:19 -0500
committerTodd Neal <todd@tneal.org>2015-11-03 02:01:34 +0000
commite3e0122ae269027bfd2e2db1dbf106883ad5a8a7 (patch)
treec3313e876d4d10a4b340f0886305fb5cc60932d3 /test/reorder2.go
parentebafc80ebaa8d7e67ba72642eed67c0adfc0c0c3 (diff)
downloadgo-e3e0122ae269027bfd2e2db1dbf106883ad5a8a7.tar.gz
go-e3e0122ae269027bfd2e2db1dbf106883ad5a8a7.zip
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 'test/reorder2.go')
-rw-r--r--test/reorder2.go24
1 files changed, 11 insertions, 13 deletions
diff --git a/test/reorder2.go b/test/reorder2.go
index e56be2bc80..3e87998ffe 100644
--- a/test/reorder2.go
+++ b/test/reorder2.go
@@ -58,9 +58,8 @@ func f(x, y string) {
log += "f(" + x + ", " + y + ")"
}
+//go:noinline
func ff(x, y string) {
- for false {
- } // prevent inl
log += "ff(" + x + ", " + y + ")"
}
@@ -69,9 +68,8 @@ func h(x string) string {
return x
}
+//go:noinline
func g(x string) string {
- for false {
- } // prevent inl
log += "g(" + x + ")"
return x
}
@@ -167,7 +165,7 @@ func main() {
err++
}
log = ""
-
+
x := 0
switch x {
case 0:
@@ -176,7 +174,7 @@ func main() {
err++
}
log = ""
-
+
if t.a("1").a(t.b("2")); log != "a(1)b(2)a(2)" {
println("in switch, expecting a(1)b(2)a(2), got ", log)
err++
@@ -194,7 +192,7 @@ func main() {
}
log = ""
}
-
+
c := make(chan int, 1)
c <- 1
select {
@@ -206,7 +204,7 @@ func main() {
err++
}
log = ""
-
+
if t.a("1").a(t.b("2")); log != "a(1)b(2)a(2)" {
println("in select1, expecting a(1)b(2)a(2), got ", log)
err++
@@ -233,7 +231,7 @@ func main() {
err++
}
log = ""
-
+
if t.a("1").a(t.b("2")); log != "a(1)b(2)a(2)" {
println("in select2, expecting a(1)b(2)a(2), got ", log)
err++
@@ -255,14 +253,14 @@ func main() {
c <- 1
select {
default:
- case c<-1:
+ case c <- 1:
case <-c:
if a("1")("2")("3"); log != "a(1)a(2)a(3)" {
println("in select3, expecting a(1)a(2)a(3) , got ", log)
err++
}
log = ""
-
+
if t.a("1").a(t.b("2")); log != "a(1)b(2)a(2)" {
println("in select3, expecting a(1)b(2)a(2), got ", log)
err++
@@ -290,7 +288,7 @@ func main() {
err++
}
log = ""
-
+
if t.a("1").a(t.b("2")); log != "a(1)b(2)a(2)" {
println("in select4, expecting a(1)b(2)a(2), got ", log)
err++
@@ -318,7 +316,7 @@ func main() {
err++
}
log = ""
-
+
if t.a("1").a(t.b("2")); log != "a(1)b(2)a(2)" {
println("in select5, expecting a(1)b(2)a(2), got ", log)
err++