summaryrefslogtreecommitdiff
path: root/gcc/testsuite/go.go-torture/execute/string-2.go
blob: 72b0f23343838cca9776f5b9842bb42ff67ead83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)
  }
}