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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [fixedbugs/] [bug012.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 main() {
11
        var u30 uint64 = 0;
12
        var u31 uint64 = 1;
13
        _, _ = u30, u31;
14
        var u32 uint64 = 18446744073709551615;
15
        var u33 uint64 = +18446744073709551615;
16
        if u32 != (1<<64)-1 { panic("u32\n"); }
17
        if u33 != (1<<64)-1 { panic("u33\n"); }
18
        var i34 int64 = ^0;  // note: 2's complement means ^0 == -1
19
        if i34 != -1 { panic("i34") }
20
}
21
/*
22
bug12.go:5: overflow converting constant to UINT64
23
bug12.go:6: overflow converting constant to UINT64
24
bug12.go:7: overflow converting constant to UINT64
25
bug12.go:8: overflow converting constant to UINT64
26
*/

powered by: WebSVN 2.1.0

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