view gcc/testsuite/go.go-torture/execute/string-1.go @ 118:fd00160c1b76

ifdef TARGET_64BIT
author mir3636
date Tue, 27 Feb 2018 15:01:35 +0900
parents 04ced10e8804
children
line wrap: on
line source

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);
  }
}