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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [fixedbugs/] [bug119.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 || echo BUG: should not fail
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
func foo(a []int) int {
10
        return a[0] // this seems to do the wrong thing
11
}
12
 
13
func main() {
14
        a := &[]int{12}
15
        if x := (*a)[0]; x != 12 {
16
                panic(2)
17
        }
18
        if x := foo(*a); x != 12 {
19
                // fails (x is incorrect)
20
                panic(3)
21
        }
22
}
23
 
24
/*
25
uetli:~/Source/go1/test/bugs gri$ 6go bug119
26
3 70160
27
 
28
panic on line 83 PC=0x14d6
29
0x14d6?zi
30
        mainĀ·main(23659, 0, 1, ...)
31
        mainĀ·main(0x5c6b, 0x1, 0x7fff5fbff830, ...)
32
0x52bb?zi
33
        mainstart(1, 0, 1606416432, ...)
34
        mainstart(0x1, 0x7fff5fbff830, 0x0, ...)
35
uetli:~/Source/go1/test/bugs gri$
36
*/

powered by: WebSVN 2.1.0

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