diff options
Diffstat (limited to 'llgo/test/execution/go.go')
| -rw-r--r-- | llgo/test/execution/go.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/llgo/test/execution/go.go b/llgo/test/execution/go.go new file mode 100644 index 00000000000..2bfe775ff92 --- /dev/null +++ b/llgo/test/execution/go.go @@ -0,0 +1,34 @@ +// RUN: llgo -o %t %s +// RUN: %t 2>&1 | FileCheck %s + +// CHECK: hello from T 1 +// CHECK-NEXT: hello from T 2 + +package main + +type T struct { + val int +} + +func (t T) Hello(done chan bool) { + println("hello from T", t.val) + done <- true +} + +type I interface { + Hello(chan bool) +} + +func main() { + done := make(chan bool) + + t := T{1} + go t.Hello(done) + <-done + + var i I = T{2} + go i.Hello(done) + <-done + + go println("hello builtin") +} |

