blob: 2bfe775ff9240e17bb9cf874993c69a1d97e593b [file] [log] [blame]
Peter Collingbournead9841e2014-11-27 00:06:42 +00001// RUN: llgo -o %t %s
2// RUN: %t 2>&1 | FileCheck %s
3
4// CHECK: hello from T 1
5// CHECK-NEXT: hello from T 2
6
7package main
8
9type T struct {
10 val int
11}
12
13func (t T) Hello(done chan bool) {
14 println("hello from T", t.val)
15 done <- true
16}
17
18type I interface {
19 Hello(chan bool)
20}
21
22func main() {
23 done := make(chan bool)
24
25 t := T{1}
26 go t.Hello(done)
27 <-done
28
29 var i I = T{2}
30 go i.Hello(done)
31 <-done
32
33 go println("hello builtin")
34}