]> Cypherpunks repositories - gostls13.git/commitdiff
code in bug was wrong; correct and improve. works now.
authorRob Pike <r@golang.org>
Mon, 11 Aug 2008 20:08:16 +0000 (13:08 -0700)
committerRob Pike <r@golang.org>
Mon, 11 Aug 2008 20:08:16 +0000 (13:08 -0700)
R=gri
OCL=14088
CL=14088

test/fixedbugs/bug012.go

index 7f5fd84b3665c5d7a2dd39f50113add42e9c20da..e51819ebb6b9935dc63933a4222b0e0a0646fb7b 100644 (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