1
0
mirror of https://github.com/golang/go synced 2024-10-03 18:21:21 -06:00
go/test/fixedbugs/issue21887.go
Anfernee Yongkun Gui 4cff104771 cmd/compile: fix print/println when input is uint
Fixes #21887

Change-Id: I30e8e03ecfb67a2c4deedc2c8436da4c4782136d
Reviewed-on: https://go-review.googlesource.com/63971
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-09-26 04:08:38 +00:00

26 lines
438 B
Go

// cmpout
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Issue 21887: println(^uint(0)) fails to compile
package main
import "strconv"
func main() {
if strconv.IntSize == 32 {
println(^uint(0))
} else {
println(^uint32(0))
}
if strconv.IntSize == 64 {
println(^uint(0))
} else {
println(^uint64(0))
}
}