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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [exp/] [types/] [testdata/] [test0.src] - Blame information for rev 747

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// Copyright 2011 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4
 
5
// type declarations
6
 
7
package test0
8
 
9
import "unsafe"
10
 
11
const pi = 3.1415
12
 
13
type (
14
        N undeclared /* ERROR "undeclared" */
15
        B bool
16
        I int32
17
        A [10]P
18
        T struct {
19
                x, y P
20
        }
21
        P *T
22
        R (*R)
23
        F func(A) I
24
        Y interface {
25
                f(A) I
26
        }
27
        S [](((P)))
28
        M map[I]F
29
        C chan<- I
30
)
31
 
32
 
33
type (
34
        p1 pi /* ERROR "not a package" */ .foo
35
        p2 unsafe.Pointer
36
)
37
 
38
 
39
type (
40
        Pi pi /* ERROR "not a type" */
41
 
42
        a /* DISABLED "illegal cycle" */ a
43
        a /* ERROR "redeclared" */ int
44
 
45
        // where the cycle error appears depends on the
46
        // order in which declarations are processed
47
        // (which depends on the order in which a map
48
        // is iterated through)
49
        b c
50
        c /* DISABLED "illegal cycle" */ d
51
        d e
52
        e b
53
 
54
        t *t
55
 
56
        U V
57
        V *W
58
        W U
59
 
60
        P1 *S2
61
        P2 P1
62
 
63
        S0 struct {
64
        }
65
        S1 struct {
66
                a, b, c int
67
                u, v, a /* ERROR "redeclared" */ float32
68
        }
69
        S2 struct {
70
                U // anonymous field
71
                // TODO(gri) recognize double-declaration below
72
                // U /* ERROR "redeclared" */ int
73
        }
74
        S3 struct {
75
                x S2
76
        }
77
        S4/* DISABLED "illegal cycle" */ struct {
78
                S4
79
        }
80
        S5 struct {
81
                S6
82
        }
83
        S6 /* DISABLED "illegal cycle" */ struct {
84
                field S7
85
        }
86
        S7 struct {
87
                S5
88
        }
89
 
90
        L1 []L1
91
        L2 []int
92
 
93
        A1 [10]int
94
        A2 /* DISABLED "illegal cycle" */ [10]A2
95
        A3 /* DISABLED "illegal cycle" */ [10]struct {
96
                x A4
97
        }
98
        A4 [10]A3
99
 
100
        F1 func()
101
        F2 func(x, y, z float32)
102
        F3 func(x, y, x /* ERROR "redeclared" */ float32)
103
        F4 func() (x, y, x /* ERROR "redeclared" */ float32)
104
        F5 func(x int) (x /* ERROR "redeclared" */ float32)
105
        F6 func(x ...int)
106
 
107
        I1 interface{}
108
        I2 interface {
109
                m1()
110
        }
111
        I3 interface {
112
                m1()
113
                m1 /* ERROR "redeclared" */ ()
114
        }
115
        I4 interface {
116
                m1(x, y, x /* ERROR "redeclared" */ float32)
117
                m2() (x, y, x /* ERROR "redeclared" */ float32)
118
                m3(x int) (x /* ERROR "redeclared" */ float32)
119
        }
120
        I5 interface {
121
                m1(I5)
122
        }
123
        I6 interface {
124
                S0 /* ERROR "non-interface" */
125
        }
126
        I7 interface {
127
                I1
128
                I1
129
        }
130
        I8 /* DISABLED "illegal cycle" */ interface {
131
                I8
132
        }
133
        I9 /* DISABLED "illegal cycle" */ interface {
134
                I10
135
        }
136
        I10 interface {
137
                I11
138
        }
139
        I11 interface {
140
                I9
141
        }
142
 
143
        C1 chan int
144
        C2 <-chan int
145
        C3 chan<- C3
146
        C4 chan C5
147
        C5 chan C6
148
        C6 chan C4
149
 
150
        M1 map[Last]string
151
        M2 map[string]M2
152
 
153
        Last int
154
)

powered by: WebSVN 2.1.0

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