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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [fixedbugs/] [bug293.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 2010 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
// http://code.google.com/p/go/issues/detail?id=846
8
 
9
package main
10
 
11
func x() (a int, b bool) {
12
        defer func(){
13
                a++
14
        }()
15
        a, b = y()
16
        return
17
}
18
 
19
func x2() (a int, b bool) {
20
        defer func(){
21
                a++
22
        }()
23
        return y()
24
}
25
 
26
func y() (int, bool) {
27
        return 4, false
28
}
29
 
30
func main() {
31
        if a, _ := x(); a != 5 {
32
                println("BUG", a)
33
        }
34
        if a, _ := x2(); a != 5 {
35
                println("BUG", a)
36
        }
37
}

powered by: WebSVN 2.1.0

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