Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / go.test / test / fixedbugs / bug059.go
blob6a77367d6765abcf63a3ba3895eb06f88187bc29
1 // $G $D/$F.go && $L $F.$A && ./$A.out
3 // Copyright 2009 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 package main
9 import "os"
11 func P(a []string) string {
12 s := "{";
13 for i := 0; i < 2; i++ {
14 if i > 0 {
15 s += ","
17 s += `"` + a[i] + `"`;
19 s +="}";
20 return s;
23 func main() {
24 m := make(map[string] []string);
25 as := new([2]string);
26 as[0] = "0";
27 as[1] = "1";
28 m["0"] = as[0:];
30 a := m["0"];
31 a[0] = "x";
32 m["0"][0] = "deleted";
33 if m["0"][0] != "deleted" {
34 os.Exit(1);