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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [chan/] [select4.go] - Blame information for rev 858

Go to most recent revision | 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
package main
4
 
5
func f() *int {
6
        println("BUG: called f")
7
        return new(int)
8
}
9
 
10
func main() {
11
        var x struct {
12
                a int
13
        }
14
        c := make(chan int, 1)
15
        c1 := make(chan int)
16
        c <- 42
17
        select {
18
        case *f() = <-c1:
19
                // nothing
20
        case x.a = <-c:
21
                if x.a != 42 {
22
                        println("BUG:", x.a)
23
                }
24
        }
25
}

powered by: WebSVN 2.1.0

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