diff options
Diffstat (limited to 'gcc/testsuite/go.test/test/interface/fail.go')
-rw-r--r-- | gcc/testsuite/go.test/test/interface/fail.go | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/testsuite/go.test/test/interface/fail.go b/gcc/testsuite/go.test/test/interface/fail.go index 72b854dc00c..81eb6cb3c15 100644 --- a/gcc/testsuite/go.test/test/interface/fail.go +++ b/gcc/testsuite/go.test/test/interface/fail.go @@ -14,18 +14,33 @@ type I interface { func main() { shouldPanic(p1) + shouldPanic(p2) } func p1() { var s *S var i I - var e interface {} + var e interface{} e = s i = e.(I) _ = i } -type S struct { +type S struct{} + +func (s *S) _() {} + +type B interface { + _() +} + +func p2() { + var s *S + var b B + var e interface{} + e = s + b = e.(B) + _ = b } func shouldPanic(f func()) { |