OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [fixedbugs/] [bug059.go] - Blame information for rev 700

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 700 jeremybenn
// $G $D/$F.go && $L $F.$A && ./$A.out
2
 
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.
6
 
7
package main
8
 
9
import "os"
10
 
11
func P(a []string) string {
12
        s := "{";
13
        for i := 0; i < 2; i++ {
14
                if i > 0 {
15
                        s += ","
16
                }
17
                s += `"` + a[i] + `"`;
18
        }
19
        s +="}";
20
        return s;
21
}
22
 
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:];
29
 
30
        a := m["0"];
31
        a[0] = "x";
32
        m["0"][0] = "deleted";
33
        if m["0"][0] != "deleted" {
34
                os.Exit(1);
35
        }
36
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.