From cbaca0be24eae02587da6a0e269a4ecf5df19a13 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Mon, 11 Aug 2008 13:08:16 -0700 Subject: [PATCH] code in bug was wrong; correct and improve. works now. R=gri OCL=14088 CL=14088 --- test/fixedbugs/bug012.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/fixedbugs/bug012.go b/test/fixedbugs/bug012.go index 7f5fd84b36..e51819ebb6 100644 --- a/test/fixedbugs/bug012.go +++ b/test/fixedbugs/bug012.go @@ -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 -- 2.48.1