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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [fixedbugs/] [bug264.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
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
// Test case for http://code.google.com/p/go/issues/detail?id=692
8
 
9
package main
10
 
11
var fooCount = 0
12
var barCount = 0
13
var balCount = 0
14
 
15
func foo() (int, int) {
16
        fooCount++
17
        return 0, 0
18
}
19
 
20
func bar() (int, int) {
21
        barCount++
22
        return 0, 0
23
}
24
 
25
func bal() (int, int) {
26
        balCount++
27
        return 0, 0
28
}
29
 
30
var a, b = foo() // foo is called once
31
var c, _ = bar() // bar is called twice
32
var _, _ = bal() // bal is called twice
33
 
34
func main() {
35
        if fooCount != 1 {
36
                panic("fooCount != 1")
37
        }
38
        if barCount != 1 {
39
                panic("barCount != 1")
40
        }
41
        if balCount != 1 {
42
                panic("balCount != 1")
43
        }
44
}

powered by: WebSVN 2.1.0

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