1
0
mirror of https://github.com/golang/go synced 2024-09-25 15:10:11 -06:00

runtime/race: fix test so it compiles

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>
This commit is contained in:
Michael Hudson-Doyle 2016-01-19 16:27:14 +13:00
parent d9b32f0c7d
commit df2a9e4a33

View 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])))