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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 700 jeremybenn
// $G $D/$F.go || echo BUG: bug393
2
 
3
// Copyright 2012 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
// issue 2672
8
// was trying binary search with an interface type
9
 
10
package main
11
 
12
func f(x interface{}) int {
13
        switch x {
14
        case 1:
15
                return 1
16
        case 2:
17
                return 2
18
        case 3:
19
                return 3
20
        case 4:
21
                return 4
22
        case "5":
23
                return 5
24
        case "6":
25
                return 6
26
        default:
27
                return 7
28
        }
29
        panic("switch")
30
}

powered by: WebSVN 2.1.0

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