]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/go.test/test/fixedbugs/bug141.go
Add Go frontend, libgo library, and Go testsuite.
[thirdparty/gcc.git] / gcc / testsuite / go.test / test / fixedbugs / bug141.go
1 // $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should run
2
3 // Copyright 2009 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
6
7 package main
8
9 import "os"
10
11 type S struct { i int }
12 func (p *S) Get() int { return p.i }
13
14 type Empty interface {
15 }
16
17 type Getter interface {
18 Get() int;
19 }
20
21 func f1(p Empty) {
22 switch x := p.(type) {
23 default: println("failed to match interface"); os.Exit(1);
24 case Getter: break;
25 }
26
27 }
28
29 func main() {
30 var s S;
31 f1(&s);
32 }