OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [fixedbugs/] [bug141.go] - Blame information for rev 700

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 700 jeremybenn
// $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", x); os.Exit(1);
24
        case Getter: break;
25
        }
26
 
27
}
28
 
29
func main() {
30
        var s S;
31
        f1(&s);
32
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.