mirror of
https://github.com/golang/go
synced 2024-09-25 15:20:13 -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:
parent
d9b32f0c7d
commit
df2a9e4a33
7
src/runtime/race/testdata/issue12225_test.go
vendored
7
src/runtime/race/testdata/issue12225_test.go
vendored
@ -4,9 +4,16 @@
|
|||||||
|
|
||||||
package race_test
|
package race_test
|
||||||
|
|
||||||
|
import "unsafe"
|
||||||
|
|
||||||
// golang.org/issue/12225
|
// golang.org/issue/12225
|
||||||
// The test is that this compiles at all.
|
// The test is that this compiles at all.
|
||||||
|
|
||||||
|
//go:noinline
|
||||||
|
func convert(s string) []byte {
|
||||||
|
return []byte(s)
|
||||||
|
}
|
||||||
|
|
||||||
func issue12225() {
|
func issue12225() {
|
||||||
println(*(*int)(unsafe.Pointer(&convert("")[0])))
|
println(*(*int)(unsafe.Pointer(&convert("")[0])))
|
||||||
println(*(*int)(unsafe.Pointer(&[]byte("")[0])))
|
println(*(*int)(unsafe.Pointer(&[]byte("")[0])))
|
||||||
|
Loading…
Reference in New Issue
Block a user