diff options
Diffstat (limited to 'gcc/testsuite/go.go-torture/execute/string-2.go')
-rw-r--r-- | gcc/testsuite/go.go-torture/execute/string-2.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/go.go-torture/execute/string-2.go b/gcc/testsuite/go.go-torture/execute/string-2.go new file mode 100644 index 000000000..72b0f2334 --- /dev/null +++ b/gcc/testsuite/go.go-torture/execute/string-2.go @@ -0,0 +1,16 @@ +package main + +func fn(s string) string { + if len(s) != 3 { + panic(0) + } + i := len(s) - 1; + return s + s[0 : i]; +} + +func main() { + s := fn("abc"); + if s != "abcab" { + panic(1) + } +} |