]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/race: fix test so it compiles
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Tue, 19 Jan 2016 03:27:14 +0000 (16:27 +1300)
committerMichael Hudson-Doyle <michael.hudson@canonical.com>
Wed, 20 Jan 2016 03:08:07 +0000 (03:08 +0000)
I'm not sure what the convert function was intended to be.

Fixes #14011

Change-Id: I29d905bc1827936b9433b20b13b7a0b0ac5f502e
Reviewed-on: https://go-review.googlesource.com/18712
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/runtime/race/testdata/issue12225_test.go

index 3b0b8ec289348392a81be35ccf48d875df27d3dd..0494493b2e9f68d1020e99a838f17688b7c94921 100644 (file)
@@ -4,9 +4,16 @@
 
 package race_test
 
+import "unsafe"
+
 // golang.org/issue/12225
 // The test is that this compiles at all.
 
+//go:noinline
+func convert(s string) []byte {
+       return []byte(s)
+}
+
 func issue12225() {
        println(*(*int)(unsafe.Pointer(&convert("")[0])))
        println(*(*int)(unsafe.Pointer(&[]byte("")[0])))