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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.go-torture/] [execute/] [select-1.go] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 698 jeremybenn
package main
2
 
3
func main() {
4
  ch1 := make(chan int);
5
  ch2 := make(chan int);
6
  go func (ch1, ch2 chan int) { ch1 <- 1; ch2 <- 2; } (ch1, ch2);
7
  count := 0;
8
  var v int;
9
  for count != 2 {
10
      select
11
        {
12
        case v := <- ch1:
13
          if v != 1 {
14
            panic(0)
15
          }
16
          count++
17
 
18
        case v = <- ch2:
19
          if v != 2 {
20
            panic(1)
21
          }
22
          count++
23
        }
24
    }
25
  if v != 2 {
26
    panic(2)
27
  }
28
}

powered by: WebSVN 2.1.0

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