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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 700 jeremybenn
// errchk $G -e $D/$F.go
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
type S struct {
10
        A, B, C, X, Y, Z int
11
}
12
 
13
type T struct {
14
        S
15
}
16
 
17
var x = 1
18
var a1 = S { 0, X: 1 }  // ERROR "mixture|undefined"
19
var a2 = S { Y: 3, Z: 2, Y: 3 } // ERROR "duplicate"
20
var a3 = T { S{}, 2, 3, 4, 5, 6 }       // ERROR "convert|too many"
21
var a4 = [5]byte{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }       // ERROR "index|too many"
22
var a5 = []byte { x: 2 }        // ERROR "index"
23
 
24
var ok1 = S { } // should be ok
25
var ok2 = T { S: ok1 }  // should be ok

powered by: WebSVN 2.1.0

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