gcc/testsuite/go.dg/cmpstring.go
raw| 1 | // { dg-do compile } |
| 2 | // { dg-options "-fgo-debug-optimization" } |
| 3 | |
| 4 | package p |
| 5 | |
| 6 | func F(x []byte, y string) bool { |
| 7 | return string(x) == y // { dg-error "no copy string\\(\\\[\\\]byte\\)" } |
| 8 | } |
| 9 | |
| 10 | func BytesEqual(x, y []byte) bool { |
| 11 | return string(x) == // { dg-error "no copy string\\(\\\[\\\]byte\\)" } |
| 12 | string(y) // { dg-error "no copy string\\(\\\[\\\]byte\\)" } |
| 13 | } |