1
0
mirror of https://github.com/golang/go synced 2024-11-25 10:17:57 -07:00

code in bug was wrong; correct and improve. works now.

R=gri
OCL=14088
CL=14088
This commit is contained in:
Rob Pike 2008-08-11 13:08:16 -07:00
parent 1e0b17b24c
commit cbaca0be24

View File

@ -12,8 +12,10 @@ func main() {
var u31 uint64 = 1;
var u32 uint64 = 18446744073709551615;
var u33 uint64 = +18446744073709551615;
if u32 != ^0 { panic "u32\n"; }
if u33 != ^0 { panic "u33\n"; }
if u32 != (1<<64)-1 { panic "u32\n"; }
if u33 != (1<<64)-1 { panic "u33\n"; }
var i34 int64 = ^0; // note: 2's complement means ^0 == -1
if i34 != -1 { panic "i34" }
}
/*
bug12.go:5: overflow converting constant to <uint64>UINT64