mirror of
https://github.com/golang/go
synced 2024-11-27 05:31:31 -07:00
4cff104771
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>
26 lines
438 B
Go
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))
|
|
}
|
|
}
|