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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 700 jeremybenn
// $G $D/embed0.go && $G $D/$F.go && $L $F.$A && ./$A.out
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
// Check that embedded interface types can have local methods.
8
 
9
package main
10
 
11
import "./embed0"
12
 
13
type T int
14
func (t T) m() {}
15
 
16
type I interface { m() }
17
type J interface { I }
18
 
19
type PI interface { p.I }
20
type PJ interface { p.J }
21
 
22
func main() {
23
        var i I
24
        var j J
25
        var t T
26
        i = t
27
        j = t
28
        _ = i
29
        _ = j
30
        i = j
31
        _ = i
32
        j = i
33
        _ = j
34
        var pi PI
35
        var pj PJ
36
        var pt p.T
37
        pi = pt
38
        pj = pt
39
        _ = pi
40
        _ = pj
41
        pi = pj
42
        _ = pi
43
        pj = pi
44
        _ = pj
45
}

powered by: WebSVN 2.1.0

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