summaryrefslogtreecommitdiff
path: root/gcc/testsuite/go.dg/cmpstring.go
blob: 81d8aee379d8f5693612fc02e351d9dd3365a4a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// { 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\\)" }
}