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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [fixedbugs/] [bug028.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
 
10
func Alloc(i int) int {
11
        switch i {
12
        default:
13
                return 5;
14
        case 1:
15
                return 1;
16
        case 10:
17
                return 10;
18
        }
19
        return 0
20
}
21
 
22
func main() {
23
        s := Alloc(7);
24
        if s != 5 { panic("bad") }
25
}
26
 
27
/*
28
bug028.go:7: unreachable statements in a switch
29
*/

powered by: WebSVN 2.1.0

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