aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/go.go-torture/execute/string-1.go
blob: f999d87525b11e646fd6a3a4b5584951b0173e1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package main

func fn(s string) int {
  if s[0] != 'a' || s[1] != 'b' || s[2] != 'c' {
    panic(0);
  }
  return len(s);
}

func main() {
  s := "abc";
  if fn(s) != 3 {
    panic(1);
  }
}