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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [struct0.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 2011 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
// zero length structs.
8
// used to not be evaluated.
9
// issue 2232.
10
 
11
package main
12
 
13
func recv(c chan interface{}) struct{} {
14
        return (<-c).(struct{})
15
}
16
 
17
var m = make(map[interface{}]int)
18
 
19
func recv1(c chan interface{}) {
20
        defer rec()
21
        m[(<-c).(struct{})] = 0
22
}
23
 
24
func rec() {
25
        recover()
26
}
27
 
28
func main() {
29
        c := make(chan interface{})
30
        go recv(c)
31
        c <- struct{}{}
32
        go recv1(c)
33
        c <- struct{}{}
34
}

powered by: WebSVN 2.1.0

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