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
20 lines
478 B
Plaintext
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
|