forked from OSchip/llvm-project
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
|