Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / go.test / test / fixedbugs / bug119.go
blob750507891ccb07f311a354fb5552d46bb068f45d
1 // $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should not fail
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 func foo(a []int) int {
10 return a[0] // this seems to do the wrong thing
13 func main() {
14 a := &[]int{12}
15 if x := (*a)[0]; x != 12 {
16 panic(2)
18 if x := foo(*a); x != 12 {
19 // fails (x is incorrect)
20 panic(3)
25 uetli:~/Source/go1/test/bugs gri$ 6go bug119
26 3 70160
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$