llvm-project/llgo/test/llgoi/interfaces.test
Peter Collingbourne 6725a83e84 Introduce llgoi, a REPL for Go
llgoi is a Go REPL based on llgo irgen and the LLVM JIT. It supports
expressions, statements, most declarations and imports, including binary
imports from the standard library and source imports from $GOPATH.

Differential Revision: http://reviews.llvm.org/D6957

llvm-svn: 226097
2015-01-15 04:13:29 +00:00

20 lines
478 B
Plaintext

// RUN: llgoi < %s | FileCheck %s
import "errors"
err := errors.New("foo")
// CHECK: err error {{.*}} = foo
err.(interface{Foo()})
// CHECK: panic: interface conversion
_, _ := err.(interface{Foo()})
// CHECK: #0 interface{Foo()} (<nil>) = <nil>
// CHECK: #1 bool = false
err.(interface{Error() string})
// CHECK: #0 interface{Error() string} {{.*}} = foo
_, _ := err.(interface{Error() string})
// CHECK: #0 interface{Error() string} {{.*}} = foo
// CHECK: #1 bool = true