view gcc/testsuite/go.dg/cmpstring.go @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
line wrap: on
line source

// { dg-do compile }
// { dg-options "-fgo-debug-optimization" }

package p

func F(x []byte, y string) bool {
	return string(x) == y // { dg-error "no copy string\\(\\\[\\\]byte\\)" }
}

func BytesEqual(x, y []byte) bool {
	return string(x) == // { dg-error "no copy string\\(\\\[\\\]byte\\)" }
		string(y)   // { dg-error "no copy string\\(\\\[\\\]byte\\)" }
}