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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [fixedbugs/] [bug177.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
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 "reflect"
10
 
11
type S1 struct{ i int }
12
type S2 struct{ S1 }
13
 
14
func main() {
15
        typ := reflect.TypeOf(S2{})
16
        f := typ.Field(0)
17
        if f.Name != "S1" || f.Anonymous != true {
18
                println("BUG: ", f.Name, f.Anonymous)
19
                return
20
        }
21
        f, ok := typ.FieldByName("S1")
22
        if !ok {
23
                println("BUG: missing S1")
24
                return
25
        }
26
        if !f.Anonymous {
27
                println("BUG: S1 is not anonymous")
28
                return
29
        }
30
}

powered by: WebSVN 2.1.0

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