summaryrefslogtreecommitdiffstats
path: root/llgo/test/execution/chan/self.go
blob: d26ee4a22f3c11d9fb3b5f5517ef2718a20092fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// RUN: llgo -o %t %s
// RUN: %t 2>&1 | FileCheck %s

// CHECK: 1
// CHECK-NEXT: 2
// CHECK-NEXT: true

package main

func main() {
	ch := make(chan int, uint8(1))

	ch <- 1
	println(<-ch)

	ch <- 2
	x, ok := <-ch
	println(x)
	println(ok)
}
OpenPOWER on IntegriCloud