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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [fixedbugs/] [bug114.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 || echo BUG: bug114 failed)
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
const B32 = 1<<32 - 1
10
const C32 = (-1) & ((1 << 32) - 1)
11
const D32 = ^0
12
 
13
func main() {
14
        if B32 != 0xFFFFFFFF {
15
                println("1<<32 - 1 is", B32, "should be", 0xFFFFFFFF)
16
                panic("fail")
17
        }
18
        if C32 != 0xFFFFFFFF {
19
                println("(-1) & ((1<<32) - 1) is", C32, "should be", 0xFFFFFFFF)
20
                panic("fail")
21
        }
22
        if D32 != -1 {
23
                println("^0 is", D32, "should be", -1)
24
                panic("fail")
25
        }
26
}

powered by: WebSVN 2.1.0

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